diff options
Diffstat (limited to 'src/modules/m_alias.cpp')
-rw-r--r-- | src/modules/m_alias.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 935cb8259..6f27ecc09 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -68,6 +68,9 @@ class ModuleAlias : public Module bool AllowBots; UserModeReference botmode; + // Whether we are actively executing an alias. + bool active; + public: void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { @@ -177,6 +180,15 @@ class ModuleAlias : public Module return MOD_RES_PASSTHRU; } + ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE + { + // Don't echo anything which is caused by an alias. + if (active) + details.echo = false; + + return MOD_RES_PASSTHRU; + } + void OnUserPostMessage(User* user, const MessageTarget& target, const MessageDetails& details) CXX11_OVERRIDE { if ((target.type != MessageTarget::TYPE_CHANNEL) || (details.type != MSG_PRIVMSG)) @@ -351,7 +363,10 @@ class ModuleAlias : public Module { pars.push_back(token); } + + active = true; ServerInstance->Parser.CallHandler(command, pars, user); + active = false; } void Prioritize() CXX11_OVERRIDE |