]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/umode_w.cpp
Simplify ModeHandler constructor
[user/henk/code/inspircd.git] / src / modes / umode_w.cpp
index af00ac17eaa7abdcc9ee987894ed059317e7d5c6..8cc31094db91fb823e9a930342b0b02eca43cfe3 100644 (file)
@@ -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(InspIRCd* Instance) : SimpleUserModeHandler(NULL, 'w')
 {
 }
 
-ModeAction ModeUserWallops::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, 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;
 }