Implement AWAY command for the admin network.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 14 Apr 2007 21:34:24 +0000 (23:34 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 14 Apr 2007 21:34:24 +0000 (23:34 +0200)
NEWS
src/admin.c

diff --git a/NEWS b/NEWS
index 064b9f6b0905780a62685ae3c667481eee2502d4..ebde7b626f61252172fe824fe527e44eca168a74 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -80,7 +80,7 @@ Ctrlproxy 3.0.2 UNRELEASED
     * Remove is_private from line struct (#12).
                (patch by Emanuele Giaquinta <e.giaquinta@glauco.it>)
 
-       * Implement ISON, USERHOST, WHO, WHOIS, JOIN, PART for admin networks. (#99)
+       * Implement ISON, USERHOST, WHO, WHOIS, JOIN, PART, AWAY for admin networks. (#99)
 
   PORTABILITY
 
index 5ce7b9ee858dbee4b41ee374e3bfa88a400afce7..67f2cb6a979bd34e1ca87cbc001ddc37191b8181 100644 (file)
@@ -653,6 +653,13 @@ static gboolean admin_to_server (struct network *n, struct client *c, const stru
                virtual_network_recv_response(n, RPL_ENDOFWHOIS, l->args[1], 
                                                                          "End of /WHOIS list.", NULL);
                return TRUE;
+       } else if (!g_strcasecmp(l->args[0], "AWAY")) {
+               if (l->args[1] != NULL && strcmp(l->args[1], "") != 0) {
+                       virtual_network_recv_response(n, RPL_NOWAWAY, "You are now marked as being away", NULL);
+               } else {
+                       virtual_network_recv_response(n, RPL_UNAWAY, "You are no longer marked as being away", NULL);
+               }
+               return TRUE;
        } else {
                virtual_network_recv_response(n, ERR_UNKNOWNCOMMAND, l->args[0], "Unknown command", NULL);
                log_global(LOG_TRACE, "Unhandled command `%s' to admin network",