]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_userip.cpp
m_mysql Fix crash on rehash when the database tags have been changed in the config
[user/henk/code/inspircd.git] / src / modules / m_userip.cpp
index 637c4fd6fbfd46216a909cdf9fe86662e36e22f6..a28c124441c6dd15302ec0bab9bdae887050f0e9 100644 (file)
@@ -35,7 +35,7 @@ class CommandUserip : public Command
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
-               std::string retbuf = std::string("340 ") + user->nick + " :";
+               std::string retbuf = "340 " + user->nick + " :";
                int nicks = 0;
 
                for (int i = 0; i < (int)parameters.size(); i++)
@@ -68,15 +68,18 @@ class ModuleUserIP : public Module
        ModuleUserIP()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
-               Implementation eventlist[] = { I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
+       void init()
+       {
+               ServerInstance->Modules->AddService(cmd);
+               Implementation eventlist[] = { I_On005Numeric };
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
+       }
 
        virtual void On005Numeric(std::string &output)
        {
-               output = output + std::string(" USERIP");
+               output = output + " USERIP";
        }
 
        virtual ~ModuleUserIP()