X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fumode_w.cpp;h=13656ec2d0d699f4660467fd86f7ed19ef8c08dd;hb=c4d6ce8c5e1802e5b834d5845e31c3adf7700585;hp=af00ac17eaa7abdcc9ee987894ed059317e7d5c6;hpb=f9636a2eff46f6829bf9e01c711ab1ba45a7d50a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/umode_w.cpp b/src/modes/umode_w.cpp index af00ac17e..13656ec2d 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(InspIRCd* Instance) : ModeHandler(Instance, 'w', 0, 0, false, MODETYPE_USER, false) +ModeUserWallops::ModeUserWallops() : SimpleUserModeHandler(NULL, "wallops", '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; }