]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_userip.cpp
Send SVSNICKs during nick collision to prevent servers that do not fully implement...
[user/henk/code/inspircd.git] / src / modules / m_userip.cpp
index 79ad1c9d69da049096385c6ccf67fbb13570c6c0..7ffeb383a1fbe4b7ab7adc5d7600e83bb1a8ef20 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -29,17 +29,25 @@ class CommandUserip : public Command
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
                std::string retbuf = std::string("340 ") + user->nick + " :";
+               int nicks = 0;
 
                for (int i = 0; i < (int)parameters.size(); i++)
                {
                        User *u = ServerInstance->FindNick(parameters[i]);
                        if ((u) && (u->registered == REG_ALL))
                        {
-                               retbuf = retbuf + u->nick + (IS_OPER(u) ? "*" : "") + "=+" + u->ident + "@" + u->GetIPString() + " ";
+                               retbuf = retbuf + u->nick + (IS_OPER(u) ? "*" : "") + "=";
+                               if (IS_AWAY(u))
+                                       retbuf += "-";
+                               else
+                                       retbuf += "+";
+                               retbuf += u->ident + "@" + u->GetIPString() + " ";
+                               nicks++;
                        }
                }
 
-               user->WriteServ(retbuf);
+               if (nicks != 0)
+                       user->WriteServ(retbuf);
 
                /* Dont send to the network */
                return CMD_LOCALONLY;