diff options
Diffstat (limited to 'src/modules/m_restrictmsg.cpp')
-rw-r--r-- | src/modules/m_restrictmsg.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp index 16a9bae86..d5d9c818c 100644 --- a/src/modules/m_restrictmsg.cpp +++ b/src/modules/m_restrictmsg.cpp @@ -20,11 +20,14 @@ #include "inspircd.h" +#include "modules/ctctags.h" -class ModuleRestrictMsg : public Module +class ModuleRestrictMsg + : public Module + , public CTCTags::EventListener { - public: - ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE + private: + ModResult HandleMessage(User* user, const MessageTarget& target) { if ((target.type == MessageTarget::TYPE_USER) && (IS_LOCAL(user))) { @@ -47,6 +50,22 @@ class ModuleRestrictMsg : public Module return MOD_RES_PASSTHRU; } + public: + ModuleRestrictMsg() + : CTCTags::EventListener(this) + { + } + + ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE + { + return HandleMessage(user, target); + } + + ModResult OnUserPreTagMessage(User* user, const MessageTarget& target, CTCTags::TagMessageDetails& details) CXX11_OVERRIDE + { + return HandleMessage(user, target); + } + Version GetVersion() CXX11_OVERRIDE { return Version("Forbids users from messaging each other. Users may still message opers and opers may message other opers.",VF_VENDOR); |