]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alias.cpp
m_spanningtree Remove duplicate code for sending channel messages from RouteCommand()
[user/henk/code/inspircd.git] / src / modules / m_alias.cpp
index 507a935339bd21d7fc0461634ea7df2c28fe5ed4..4d942854cbdeff85c5aa5dd2093a205a1ea37643 100644 (file)
@@ -67,6 +67,7 @@ class ModuleAlias : public Module
 
        /* whether or not +B users are allowed to use fantasy commands */
        bool AllowBots;
+       UserModeReference botmode;
 
        void ReadAliases()
        {
@@ -96,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
@@ -187,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;
                }