X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fumode_w.cpp;h=af00ac17eaa7abdcc9ee987894ed059317e7d5c6;hb=76ebc88ccd6fef0bf2d97b607829fb3466e273af;hp=9115a67862132911759ef1e9eb298a26fae7e977;hpb=d40e1e5b0b8c4b94359637921387cd80e9de991b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/umode_w.cpp b/src/modes/umode_w.cpp index 9115a6786..af00ac17e 100644 --- a/src/modes/umode_w.cpp +++ b/src/modes/umode_w.cpp @@ -4,7 +4,7 @@ #include "users.h" #include "modes/umode_w.h" -ModeUserWallops::ModeUserWallops() : ModeHandler('w', 0, 0, false, MODETYPE_USER, false) +ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : ModeHandler(Instance, 'w', 0, 0, false, MODETYPE_USER, false) { } @@ -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; }