]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_userip.cpp
Merge pull request #495 from SaberUK/master+fix-libcpp
[user/henk/code/inspircd.git] / src / modules / m_userip.cpp
index 637c4fd6fbfd46216a909cdf9fe86662e36e22f6..fdceda0630fa7ef6f1d68c5d526518aef64f5508 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++)
@@ -43,8 +43,8 @@ class CommandUserip : public Command
                        User *u = ServerInstance->FindNick(parameters[i]);
                        if ((u) && (u->registered == REG_ALL))
                        {
-                               retbuf = retbuf + u->nick + (IS_OPER(u) ? "*" : "") + "=";
-                               if (IS_AWAY(u))
+                               retbuf = retbuf + u->nick + (u->IsOper() ? "*" : "") + "=";
+                               if (u->IsAway())
                                        retbuf += "-";
                                else
                                        retbuf += "+";
@@ -68,27 +68,24 @@ class ModuleUserIP : public Module
        ModuleUserIP()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
-               Implementation eventlist[] = { I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
-
-       virtual void On005Numeric(std::string &output)
+       void init()
        {
-               output = output + std::string(" USERIP");
+               ServerInstance->Modules->AddService(cmd);
+               Implementation eventlist[] = { I_On005Numeric };
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
-       virtual ~ModuleUserIP()
+       virtual void On005Numeric(std::map<std::string, std::string>& tokens)
        {
+               tokens["USERIP"];
        }
 
        virtual Version GetVersion()
        {
                return Version("Provides support for USERIP command",VF_VENDOR);
        }
-
 };
 
 MODULE_INIT(ModuleUserIP)
-