summaryrefslogtreecommitdiff
path: root/src/modules/m_muteban.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_muteban.cpp')
-rw-r--r--src/modules/m_muteban.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/modules/m_muteban.cpp b/src/modules/m_muteban.cpp
index 61d592b2b..5a8d60f2a 100644
--- a/src/modules/m_muteban.cpp
+++ b/src/modules/m_muteban.cpp
@@ -19,13 +19,21 @@
#include "inspircd.h"
+#include "modules/ctctags.h"
-class ModuleQuietBan : public Module
+class ModuleQuietBan
+ : public Module
+ , public CTCTags::EventListener
{
private:
bool notifyuser;
public:
+ ModuleQuietBan()
+ : CTCTags::EventListener(this)
+ {
+ }
+
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* tag = ServerInstance->Config->ConfValue("muteban");
@@ -37,7 +45,7 @@ class ModuleQuietBan : public Module
return Version("Implements extban +b m: - mute bans",VF_OPTCOMMON|VF_VENDOR);
}
- ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE
+ ModResult HandleMessage(User* user, const MessageTarget& target, bool& echo_original) CXX11_OVERRIDE
{
if (!IS_LOCAL(user) || target.type != MessageTarget::TYPE_CHANNEL)
return MOD_RES_PASSTHRU;
@@ -47,7 +55,7 @@ class ModuleQuietBan : public Module
{
if (!notifyuser)
{
- details.echo_original = true;
+ echo_original = true;
return MOD_RES_DENY;
}
@@ -58,6 +66,16 @@ class ModuleQuietBan : public Module
return MOD_RES_PASSTHRU;
}
+ ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE
+ {
+ return HandleMessage(user, target, details.echo_original);
+ }
+
+ ModResult OnUserPreTagMessage(User* user, const MessageTarget& target, CTCTags::TagMessageDetails& details) CXX11_OVERRIDE
+ {
+ return HandleMessage(user, target, details.echo_original);
+ }
+
void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
{
tokens["EXTBAN"].push_back('m');