First check if channel has mode "N", then check membership
authorAlexander Barton <alex@barton.de>
Sat, 1 Aug 2015 12:21:32 +0000 (14:21 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 1 Aug 2015 12:26:11 +0000 (14:26 +0200)
This should be more efficient.

src/ngircd/irc-login.c

index 35026e5..9fca622 100644 (file)
@@ -266,8 +266,8 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
                           !Client_HasMode(Client, 'o')) {
                                chan = Channel_First();
                                while (chan) {
-                                       if(Channel_IsMemberOf(chan, Client) &&
-                                          Channel_HasMode(chan, 'N'))
+                                       if(Channel_HasMode(chan, 'N') &&
+                                          Channel_IsMemberOf(chan, Client))
                                                return IRC_WriteErrClient(Client,
                                                                          ERR_NONICKCHANGE_MSG,
                                                                          Client_ID(Client),