summaryrefslogtreecommitdiff
path: root/src/modules/m_operchans.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_operchans.cpp')
-rw-r--r--src/modules/m_operchans.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index 074c644e1..2e6fad79f 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -24,32 +24,13 @@
/* $ModDesc: Provides support for oper-only chans via the +O channel mode */
-class OperChans : public ModeHandler
+class OperChans : public SimpleChannelModeHandler
{
public:
/* This is an oper-only mode */
- OperChans(Module* Creator) : ModeHandler(Creator, "operonly", 'O', PARAM_NONE, MODETYPE_CHANNEL) { oper = true; }
-
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+ OperChans(Module* Creator) : SimpleChannelModeHandler(Creator, "operonly", 'O')
{
- if (adding)
- {
- if (!channel->IsModeSet('O'))
- {
- channel->SetMode('O',true);
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- if (channel->IsModeSet('O'))
- {
- channel->SetMode('O',false);
- return MODEACTION_ALLOW;
- }
- }
-
- return MODEACTION_DENY;
+ oper = true;
}
};