]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/umode_w.cpp
Forward-port r10257, fixes bug #599 reported by mixx941.
[user/henk/code/inspircd.git] / src / modes / umode_w.cpp
index 8cfbf8fd24df6d9cab091cbba0cec6b88a386c10..fe4ba8ccdb971c50c3405854e993acbd0ceec8c1 100644 (file)
@@ -1,26 +1,27 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/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(Instance, '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;
 }