From 0fa8cdd7b87779e3517e296689703f1d7a7c86df Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 4 Jul 2012 17:13:41 +0200 Subject: Use SimpleUserModeHandler/SimpleChannelModeHandler where possible --- src/modules/m_hideoper.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'src/modules/m_hideoper.cpp') diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index cde50b1a9..998a57bb3 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -25,35 +25,13 @@ /** Handles user mode +H */ -class HideOper : public ModeHandler +class HideOper : public SimpleUserModeHandler { public: - HideOper(Module* Creator) : ModeHandler(Creator, "hideoper", 'H', PARAM_NONE, MODETYPE_USER) + HideOper(Module* Creator) : SimpleUserModeHandler(Creator, "hideoper", 'H') { oper = true; } - - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, 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; - } }; class ModuleHideOper : public Module -- cgit v1.2.3