]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_i.cpp
Add ParamChannelModeHandler
[user/henk/code/inspircd.git] / src / modes / cmode_i.cpp
index 5dd2572bf725274cc18014039de67c89f9132bbf..3b79d6a152d108cc577c3516aeac13c1ff7fca4b 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  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 "users.h"
 #include "modes/cmode_i.h"
 
-ModeChannelInviteOnly::ModeChannelInviteOnly(InspIRCd* Instance) : ModeHandler(Instance, 'i', 0, 0, false, MODETYPE_CHANNEL, false)
+ModeChannelInviteOnly::ModeChannelInviteOnly() : SimpleChannelModeHandler(NULL, "invite", 'i')
 {
 }
 
-ModeAction ModeChannelInviteOnly::OnModeChange(User*, User*, Channel* channel, std::string&, bool adding)
-{
-       if (channel->modes[CM_INVITEONLY] != adding)
-       {
-               channel->modes[CM_INVITEONLY] = adding;
-               return MODEACTION_ALLOW;
-       }
-       else
-       {
-               return MODEACTION_DENY;
-       }
-}