X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fumode_w.cpp;h=8cc31094db91fb823e9a930342b0b02eca43cfe3;hb=1524caf2f799cff54c2de330c9670a0b761ba3d8;hp=8cfbf8fd24df6d9cab091cbba0cec6b88a386c10;hpb=3f389a4bd951cbf6f8ca139473647eaae0447322;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/umode_w.cpp b/src/modes/umode_w.cpp index 8cfbf8fd2..8cc31094d 100644 --- a/src/modes/umode_w.cpp +++ b/src/modes/umode_w.cpp @@ -1,26 +1,27 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + #include "inspircd.h" #include "mode.h" #include "channels.h" #include "users.h" #include "modes/umode_w.h" -ModeUserWallops::ModeUserWallops() : ModeHandler('w', 0, 0, false, MODETYPE_USER, false) +ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : SimpleUserModeHandler(NULL, 'w') { } -ModeAction ModeUserWallops::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) +unsigned int ModeUserWallops::GetCount() { - /* Only opers can change other users modes */ - if ((source != dest) && (!*source->oper)) - return MODEACTION_DENY; - - /* Set the bitfields */ - if (dest->modes[UM_WALLOPS] != adding) - { - dest->modes[UM_WALLOPS] = adding; - return MODEACTION_ALLOW; - } - - /* Allow the change */ - return MODEACTION_DENY; + return count; }