summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/commands/os_sxline.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp
index 3fde89871..eb3d570ec 100644
--- a/modules/commands/os_sxline.cpp
+++ b/modules/commands/os_sxline.cpp
@@ -354,9 +354,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty())
reason = "[" + source.GetNick() + "] " + reason;
- if (!this->xlm()->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;
@@ -380,6 +378,9 @@ class CommandOSSNLine : public CommandOSSXLineBase
return;
}
+ if (!this->xlm()->CanAdd(source, mask, expires, reason))
+ return;
+
EventReturn MOD_RESULT;
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm()));
if (MOD_RESULT == EVENT_STOP)
@@ -561,9 +562,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty())
reason = "[" + source.GetNick() + "] " + reason;
- if (!this->sqlines->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;
@@ -587,6 +586,9 @@ class CommandOSSQLine : public CommandOSSXLineBase
return;
}
+ if (!this->sqlines->CanAdd(source, mask, expires, reason))
+ return;
+
EventReturn MOD_RESULT;
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm()));
if (MOD_RESULT == EVENT_STOP)