summaryrefslogtreecommitdiff
path: root/src/cmd_kline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd_kline.cpp')
-rw-r--r--src/cmd_kline.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cmd_kline.cpp b/src/cmd_kline.cpp
index a72624342..eab027b70 100644
--- a/src/cmd_kline.cpp
+++ b/src/cmd_kline.cpp
@@ -43,20 +43,21 @@ CmdResult cmd_kline::Handle (const char** parameters, int pcnt, userrec *user)
return CMD_FAILURE;
}
- if (ServerInstance->XLines->add_kline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]))
+ long duration = ServerInstance->Duration(parameters[1]);
+ if (ServerInstance->XLines->add_kline(duration,user->nick,parameters[2],parameters[0]))
{
int to_apply = APPLY_KLINES;
- FOREACH_MOD(I_OnAddKLine,OnAddKLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0]));
+ FOREACH_MOD(I_OnAddKLine,OnAddKLine(duration, user, parameters[2], parameters[0]));
- if (!ServerInstance->Duration(parameters[1]))
+ if (!duration)
{
ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent K-line for %s.",user->nick,parameters[0]);
to_apply |= APPLY_PERM_ONLY;
}
else
{
- time_t c_requires_crap = ServerInstance->Duration(parameters[1]) + ServerInstance->Time();
+ time_t c_requires_crap = duration + ServerInstance->Time();
ServerInstance->SNO->WriteToSnoMask('x',"%s added timed K-line for %s, expires on %s",user->nick,parameters[0],
ServerInstance->TimeString(c_requires_crap).c_str());
}