X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_zline.cpp;h=a9f76a9328b286c1d6dcede0cf26411fae5d809e;hb=5db1d322be106c8462dc691072f9415dc0766ed4;hp=e701867fb7c56c7dbad4244c8f984cf4641944ee;hpb=c45fe6715d51a0b6565fee1321c45645883fa749;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index e701867fb..a9f76a932 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -2,11 +2,11 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * 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. * * --------------------------------------------------- */ @@ -32,17 +32,33 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user) return CMD_FAILURE; } + User *u = ServerInstance->FindNick(parameters[0]); + + if (u) + { + parameters[0] = u->GetIPString(); + } + if (ServerInstance->IPMatchesEveryone(parameters[0],user)) return CMD_FAILURE; 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) { - while (*ipaddr != '@') + ipaddr = find->GetIPString(); + } + else + { + 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 +83,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]); }