Handle services in IRC_WHOIS_SendReply()
authorFederico G. Schwindt <fgsch@lodoss.net>
Thu, 18 Jul 2013 18:52:17 +0000 (19:52 +0100)
committerFederico G. Schwindt <fgsch@lodoss.net>
Thu, 18 Jul 2013 18:52:17 +0000 (19:52 +0100)
If the target is a service, advertise it as such and ignore operator mode.

src/ngircd/irc-info.c

index 668f5ed6fc4c5be0bb8445531282398c7e52284c..046648fdfa02cab53369ccbf81f33de40801de0f 100644 (file)
@@ -361,8 +361,15 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
                        return DISCONNECTED;
        }
 
+       /* IRC-Services? */
+       if (Client_Type(c) == CLIENT_SERVICE &&
+           !IRC_WriteStrClient(from, RPL_WHOISSERVICE_MSG,
+                               Client_ID(from), Client_ID(c)))
+               return DISCONNECTED;
+
        /* IRC-Operator? */
-       if (Client_HasMode(c, 'o') &&
+       if (Client_Type(c) != CLIENT_SERVICE &&
+           Client_HasMode(c, 'o') &&
            !IRC_WriteStrClient(from, RPL_WHOISOPERATOR_MSG,
                                Client_ID(from), Client_ID(c)))
                return DISCONNECTED;