summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-06-24 15:55:14 +0200
committerRobin Burchell <robin+git@viroteck.net>2012-06-30 00:13:34 +0200
commitc71942c2ee6c73776b5e11d2bc9888f44dc3409d (patch)
tree2e9860ce9e09384902f75172de103e60ce14d4cb
parent77630814c03148cbb1c532dcfcb37b0e1dbfa9df (diff)
m_nonicks Use SimpleChannelModeHandler
-rw-r--r--src/modules/m_nonicks.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 4d56ad35f..f5c404682 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -23,32 +23,10 @@
/* $ModDesc: Provides support for channel mode +N & extban +b N: which prevents nick changes on channel */
-class NoNicks : public ModeHandler
+class NoNicks : public SimpleChannelModeHandler
{
public:
- NoNicks(Module* Creator) : ModeHandler(Creator, "nonick", 'N', PARAM_NONE, MODETYPE_CHANNEL) { }
-
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
- {
- if (adding)
- {
- if (!channel->IsModeSet('N'))
- {
- channel->SetMode('N',true);
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- if (channel->IsModeSet('N'))
- {
- channel->SetMode('N',false);
- return MODEACTION_ALLOW;
- }
- }
-
- return MODEACTION_DENY;
- }
+ NoNicks(Module* Creator) : SimpleChannelModeHandler(Creator, "nonick", 'N') { }
};
class ModuleNoNickChange : public Module