summaryrefslogtreecommitdiff
path: root/src/modules/m_helpop.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-07-04 17:13:41 +0200
committerattilamolnar <attilamolnar@hush.com>2012-07-13 17:29:26 +0200
commit0fa8cdd7b87779e3517e296689703f1d7a7c86df (patch)
treea2efa8200dbd9750cfd76c82b3ed71c792453e47 /src/modules/m_helpop.cpp
parent2a5cab9b4471b4536c3576ec20cb2b6d6bc122e3 (diff)
Use SimpleUserModeHandler/SimpleChannelModeHandler where possible
Diffstat (limited to 'src/modules/m_helpop.cpp')
-rw-r--r--src/modules/m_helpop.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index bbc7ae3ac..60c23f45b 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -29,35 +29,13 @@ static std::map<irc::string, std::string> helpop_map;
/** Handles user mode +h
*/
-class Helpop : public ModeHandler
+class Helpop : public SimpleUserModeHandler
{
public:
- Helpop(Module* Creator) : ModeHandler(Creator, "helpop", 'h', PARAM_NONE, MODETYPE_USER)
+ Helpop(Module* Creator) : SimpleUserModeHandler(Creator, "helpop", 'h')
{
oper = true;
}
-
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
- {
- if (adding)
- {
- if (!dest->IsModeSet('h'))
- {
- dest->SetMode('h',true);
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- if (dest->IsModeSet('h'))
- {
- dest->SetMode('h',false);
- return MODEACTION_ALLOW;
- }
- }
-
- return MODEACTION_DENY;
- }
};
/** Handles /HELPOP