summaryrefslogtreecommitdiff
path: root/src/commands/cmd_zline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/cmd_zline.cpp')
-rw-r--r--src/commands/cmd_zline.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp
index 520bea306..1b765bbb4 100644
--- a/src/commands/cmd_zline.cpp
+++ b/src/commands/cmd_zline.cpp
@@ -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))