diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_helpop.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 661860b0a..0cfca57d0 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -19,10 +19,32 @@ static std::map<irc::string, std::string> helpop_map; /** Handles user mode +h */ -class Helpop : public SimpleUserModeHandler +class Helpop : public ModeHandler { public: - Helpop(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'h') { } + Helpop(InspIRCd* Instance) : ModeHandler(Instance, 'h', 0, 0, false, MODETYPE_USER, true) { } + + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) + { + 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 |