]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/umode_w.cpp
Fix the remote +k-k stuff
[user/henk/code/inspircd.git] / src / modes / umode_w.cpp
index 9115a67862132911759ef1e9eb298a26fae7e977..8cfbf8fd24df6d9cab091cbba0cec6b88a386c10 100644 (file)
@@ -12,14 +12,15 @@ ModeAction ModeUserWallops::OnModeChange(userrec* source, userrec* dest, chanrec
 {
        /* Only opers can change other users modes */
        if ((source != dest) && (!*source->oper))
-               return MODEACTION_ALLOW;
+               return MODEACTION_DENY;
 
        /* Set the bitfields */
-       adding ? dest->modebits |= UM_WALLOPS : dest->modebits &= ~UM_WALLOPS;
-
-       /* Use the bitfields to build the user's mode string */
-       ModeParser::BuildModeString(dest);
+       if (dest->modes[UM_WALLOPS] != adding)
+       {
+               dest->modes[UM_WALLOPS] = adding;
+               return MODEACTION_ALLOW;
+       }
 
        /* Allow the change */
-       return MODEACTION_ALLOW;
+       return MODEACTION_DENY;
 }