diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-06-24 15:55:14 +0200 |
---|---|---|
committer | Robin Burchell <robin+git@viroteck.net> | 2012-06-30 00:13:34 +0200 |
commit | c71942c2ee6c73776b5e11d2bc9888f44dc3409d (patch) | |
tree | 2e9860ce9e09384902f75172de103e60ce14d4cb /src/modules | |
parent | 77630814c03148cbb1c532dcfcb37b0e1dbfa9df (diff) |
m_nonicks Use SimpleChannelModeHandler
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_nonicks.cpp | 26 |
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 ¶meter, 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 |