]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_zline.cpp
Fake lag on nick change, thanks pLaYa
[user/henk/code/inspircd.git] / src / commands / cmd_zline.cpp
index e701867fb7c56c7dbad4244c8f984cf4641944ee..1b765bbb4c107626ed059e5c18e2be62125e4e8b 100644 (file)
@@ -6,7 +6,7 @@
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ *         the file COPYING for details.
  *
  * ---------------------------------------------------
  */
@@ -37,12 +37,21 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user)
 
                long duration = ServerInstance->Duration(parameters[1]);
 
-               const char* ipaddr = parameters[0]; 
-               if (strchr(ipaddr,'@'))
+               const char* ipaddr = parameters[0];
+               User* find = ServerInstance->FindNick(parameters[0]);
+
+               if (find)
+               {
+                       ipaddr = find->GetIPString();
+               }
+               else
                {
-                       while (*ipaddr != '@')
+                       if (strchr(ipaddr,'@'))
+                       {
+                               while (*ipaddr != '@')
+                                       ipaddr++;
                                ipaddr++;
-                       ipaddr++;
+                       }
                }
                ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], ipaddr);
                if (ServerInstance->XLines->AddLine(zl,user))
@@ -67,7 +76,7 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user)
        }
        else
        {
-               if (ServerInstance->XLines->DelLine(parameters[0],'Z',user))
+               if (ServerInstance->XLines->DelLine(parameters[0],"Z",user))
                {
                        ServerInstance->SNO->WriteToSnoMask('x',"%s Removed Z-line on %s.",user->nick,parameters[0]);
                }