]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/umode_s.cpp
Fix desync with halfop and voice when opped (this happens because we were ORing the...
[user/henk/code/inspircd.git] / src / modes / umode_s.cpp
index 0c005f56a6d69bd93bf62eda56b7d0a7a9b3d1ae..4b3179001af415419eb14950628f1ba05720bdd8 100644 (file)
@@ -1,10 +1,23 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 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_s.h"
 
-ModeUserServerNotice::ModeUserServerNotice() : ModeHandler('s', 0, 0, false, MODETYPE_USER, false)
+ModeUserServerNotice::ModeUserServerNotice(InspIRCd* Instance) : ModeHandler(Instance, 's', 0, 0, false, MODETYPE_USER, false)
 {
 }
 
@@ -18,9 +31,15 @@ ModeAction ModeUserServerNotice::OnModeChange(userrec* source, userrec* dest, ch
        if (dest->modes[UM_SERVERNOTICE] != adding)
        {
                dest->modes[UM_SERVERNOTICE] = adding;
+               this->count += (adding ? 1: -1);
                return MODEACTION_ALLOW;
        }
 
        /* Allow the change */
        return MODEACTION_DENY;
 }
+
+unsigned int ModeUserServerNotice::GetCount()
+{
+       return count;
+}