diff options
author | Sadie Powell <sadie@witchery.services> | 2020-01-05 15:22:40 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-01-05 15:22:40 +0000 |
commit | 473df5542f96cf572a918979db843a75a2c94798 (patch) | |
tree | 1a4e635d9096eaed97290c50bc729139680eaa69 /src | |
parent | 007e0b46a82f0aa4ebe47472d0fed63d845107b7 (diff) |
Add an oper only parameter to Simple{Channel,User}ModeHandler.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_helpop.cpp | 20 | ||||
-rw-r--r-- | src/modules/m_operchans.cpp | 14 |
2 files changed, 8 insertions, 26 deletions
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 5aa719c2f..d957fb786 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -39,17 +39,6 @@ enum typedef std::map<std::string, std::string, irc::insensitive_swo> HelpopMap; static HelpopMap helpop_map; -/** Handles user mode +h - */ -class Helpop : public SimpleUserModeHandler -{ - public: - Helpop(Module* Creator) : SimpleUserModeHandler(Creator, "helpop", 'h') - { - oper = true; - } -}; - /** Handles /HELPOP */ class CommandHelpop : public Command @@ -107,16 +96,19 @@ class CommandHelpop : public Command } }; -class ModuleHelpop : public Module, public Whois::EventListener +class ModuleHelpop + : public Module + , public Whois::EventListener { + private: CommandHelpop cmd; - Helpop ho; + SimpleUserModeHandler ho; public: ModuleHelpop() : Whois::EventListener(this) , cmd(this) - , ho(this) + , ho(this, "helpop", 'h', true) { } diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 8f6003923..6863fc244 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -28,26 +28,16 @@ enum ERR_CANTJOINOPERSONLY = 520 }; -class OperChans : public SimpleChannelModeHandler -{ - public: - /* This is an oper-only mode */ - OperChans(Module* Creator) : SimpleChannelModeHandler(Creator, "operonly", 'O') - { - oper = true; - } -}; - class ModuleOperChans : public Module { private: - OperChans oc; + SimpleChannelModeHandler oc; std::string space; std::string underscore; public: ModuleOperChans() - : oc(this) + : oc(this, "operonly", 'O', true) , space(" ") , underscore("_") { |