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.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp
index b0df24a95..fa54590e2 100644
--- a/src/commands/cmd_zline.cpp
+++ b/src/commands/cmd_zline.cpp
@@ -41,27 +41,20 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
target = u->GetIPString();
}
- if (ServerInstance->IPMatchesEveryone(target.c_str(),user))
- return CMD_FAILURE;
-
- long duration = ServerInstance->Duration(parameters[1].c_str());
-
const char* ipaddr = target.c_str();
- User* find = ServerInstance->FindNick(target.c_str());
- if (find)
- {
- ipaddr = find->GetIPString();
- }
- else
+ if (strchr(ipaddr,'@'))
{
- if (strchr(ipaddr,'@'))
- {
- while (*ipaddr != '@')
- ipaddr++;
+ while (*ipaddr != '@')
ipaddr++;
- }
+ ipaddr++;
}
+
+ if (ServerInstance->IPMatchesEveryone(ipaddr,user))
+ return CMD_FAILURE;
+
+ long duration = ServerInstance->Duration(parameters[1].c_str());
+
ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr);
if (ServerInstance->XLines->AddLine(zl,user))
{