summaryrefslogtreecommitdiff
path: root/modules/commands/os_akill.cpp
diff options
context:
space:
mode:
authorMatt Ullman <blindsight@gamesurge.net>2015-07-28 18:44:22 -0400
committerAdam <Adam@anope.org>2015-12-13 19:58:40 -0500
commit593ec34ff70809189fbcb885be582ad334df0cb9 (patch)
tree137bf73cb066b593dbabd708e7fcbfb880a51a91 /modules/commands/os_akill.cpp
parentdfc18db1dd3d18a977b3b1cb073c6b99a17e15f6 (diff)
os_akill: Sanity check AKILLing before modifing the akill list
Diffstat (limited to 'modules/commands/os_akill.cpp')
-rw-r--r--modules/commands/os_akill.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp
index fc2558f2c..81c440ef3 100644
--- a/modules/commands/os_akill.cpp
+++ b/modules/commands/os_akill.cpp
@@ -156,9 +156,7 @@ class CommandOSAKill : public Command
if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty())
reason = "[" + source.GetNick() + "] " + reason;
- if (!akills->CanAdd(source, mask, expires, reason))
- return;
- else if (mask.find_first_not_of("/~@.*?") == Anope::string::npos)
+ if (mask.find_first_not_of("/~@.*?") == Anope::string::npos)
{
source.Reply(USERHOST_MASK_TOO_WIDE, mask.c_str());
return;
@@ -187,6 +185,9 @@ class CommandOSAKill : public Command
return;
}
+ if (!akills->CanAdd(source, mask, expires, reason))
+ return;
+
EventReturn MOD_RESULT;
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, akills));
if (MOD_RESULT == EVENT_STOP)