X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alias.cpp;h=4d942854cbdeff85c5aa5dd2093a205a1ea37643;hb=67de413cad88194972d55a8ff88464370890c5a9;hp=7343dd21ba58d9f907859b4d1216c115a529b5cf;hpb=cc79342f50ce345657fca16c90f1d37a9228d8ad;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 7343dd21b..4d942854c 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -22,8 +22,6 @@ #include "inspircd.h" -/* $ModDesc: Provides aliases of commands. */ - /** An alias definition */ class Alias @@ -69,6 +67,7 @@ class ModuleAlias : public Module /* whether or not +B users are allowed to use fantasy commands */ bool AllowBots; + UserModeReference botmode; void ReadAliases() { @@ -98,11 +97,14 @@ class ModuleAlias : public Module } public: + ModuleAlias() + : botmode(this, "bot") + { + } + void init() CXX11_OVERRIDE { ReadAliases(); - Implementation eventlist[] = { I_OnPreCommand, I_OnRehash, I_OnUserMessage }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } Version GetVersion() CXX11_OVERRIDE @@ -189,7 +191,7 @@ class ModuleAlias : public Module } /* Stop here if the user is +B and allowbot is set to no. */ - if (!AllowBots && user->IsModeSet('B')) + if (!AllowBots && user->IsModeSet(botmode)) { return; }