]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alias.cpp
m_auditorium Switch to SimpleChannelModeHandler
[user/henk/code/inspircd.git] / src / modules / m_alias.cpp
index 4d942854cbdeff85c5aa5dd2093a205a1ea37643..b0fda70bbdbe16b23f1b0964b0ad64c41ecf2b26 100644 (file)
@@ -69,7 +69,8 @@ class ModuleAlias : public Module
        bool AllowBots;
        UserModeReference botmode;
 
-       void ReadAliases()
+ public:
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* fantasy = ServerInstance->Config->ConfValue("fantasy");
                AllowBots = fantasy->getBool("allowbots", false);
@@ -96,17 +97,11 @@ class ModuleAlias : public Module
                }
        }
 
- public:
        ModuleAlias()
                : botmode(this, "bot")
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ReadAliases();
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides aliases of commands.", VF_VENDOR);
@@ -273,7 +268,7 @@ class ModuleAlias : public Module
                        u = ServerInstance->FindNick(a->RequiredNick);
                        if (!u)
                        {
-                               user->WriteNumeric(401, ""+user->nick+" "+a->RequiredNick+" :is currently unavailable. Please try again later.");
+                               user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick + " :is currently unavailable. Please try again later.");
                                return 1;
                        }
                }
@@ -282,7 +277,7 @@ class ModuleAlias : public Module
                        if (!ServerInstance->ULine(u->server))
                        {
                                ServerInstance->SNO->WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+std::string(a->AliasedCommand.c_str())+" is not on a u-lined server, possibly underhanded antics detected!");
-                               user->WriteNumeric(401, ""+user->nick+" "+a->RequiredNick+" :is an imposter! Please inform an IRC operator as soon as possible.");
+                               user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick + " :is an imposter! Please inform an IRC operator as soon as possible.");
                                return 1;
                        }
                }
@@ -369,11 +364,6 @@ class ModuleAlias : public Module
                ServerInstance->Parser->CallHandler(command, pars, user);
        }
 
-       void OnRehash(User* user) CXX11_OVERRIDE
-       {
-               ReadAliases();
-       }
-
        void Prioritize()
        {
                // Prioritise after spanningtree so that channel aliases show the alias before the effects.