]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc.c
Simplify mode checking on channels and users within a channel
[ngircd-alex.git] / src / ngircd / irc.c
index dbce773b72810972a1f67f50a9f3a68eeda75115..e4f483070c1ae494040820f3ea2fe2b9fb0883fb 100644 (file)
@@ -111,7 +111,7 @@ IRC_ERROR(CLIENT *Client, REQUEST *Req)
 /**
  * Handler for the IRC "KILL" command.
  *
- * This function implements the IRC command "KILL" wich is used to selectively
+ * This function implements the IRC command "KILL" which is used to selectively
  * disconnect clients. It can be used by IRC operators and servers, for example
  * to "solve" nick collisions after netsplits. See RFC 2812 section 3.7.1.
  *
@@ -329,7 +329,7 @@ IRC_TRACE(CLIENT *Client, REQUEST *Req)
                                        return DISCONNECTED;
                        }
                        if (Client_Type(c) == CLIENT_USER
-                           && strchr(Client_Modes(c), 'o')) {
+                           && Client_HasMode(c, 'o')) {
                                /* IRC Operator */
                                if (!IRC_WriteStrClient(from,
                                                RPL_TRACEOPERATOR_MSG,
@@ -652,7 +652,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
                        }
 
                        if (SendErrors && (Client_Type(Client) != CLIENT_SERVER)
-                           && strchr(Client_Modes(cl), 'a')) {
+                           && Client_HasMode(cl, 'a')) {
                                /* Target is away */
                                if (!IRC_WriteStrClient(from, RPL_AWAY_MSG,
                                                        Client_ID(from),
@@ -708,7 +708,7 @@ Send_Message_Mask(CLIENT * from, char * command, char * targetMask,
 
        cl = NULL;
 
-       if (strchr(Client_Modes(from), 'o') == NULL) {
+       if (!Client_HasMode(from, 'o')) {
                if (!SendErrors)
                        return true;
                return IRC_WriteStrClient(from, ERR_NOPRIVILEGES_MSG,