summaryrefslogtreecommitdiff
path: root/src/cmd_qline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd_qline.cpp')
-rw-r--r--src/cmd_qline.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/cmd_qline.cpp b/src/cmd_qline.cpp
index 3bffa2f34..951f39df8 100644
--- a/src/cmd_qline.cpp
+++ b/src/cmd_qline.cpp
@@ -37,17 +37,22 @@ CmdResult cmd_qline::Handle (const char** parameters, int pcnt, userrec *user)
return CMD_FAILURE;
}
- ServerInstance->XLines->add_qline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]);
- FOREACH_MOD(I_OnAddQLine,OnAddQLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0]));
- if (!ServerInstance->Duration(parameters[1]))
+ if (ServerInstance->XLines->add_qline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]))
{
- ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Q-line for %s.",user->nick,parameters[0]);
- }
- else
- {
- ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Q-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1]));
+ int to_apply = APPLY_QLINES;
+
+ FOREACH_MOD(I_OnAddQLine,OnAddQLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0]));
+ if (!ServerInstance->Duration(parameters[1]))
+ {
+ to_apply |= APPLY_PERM_ONLY;
+ ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent Q-line for %s.",user->nick,parameters[0]);
+ }
+ else
+ {
+ ServerInstance->SNO->WriteToSnoMask('x',"%s added timed Q-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1]));
+ }
+ ServerInstance->XLines->apply_lines(to_apply);
}
- ServerInstance->XLines->apply_lines(APPLY_QLINES);
}
else
{