summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <adam@sigterm.info>2014-11-03 23:43:50 -0500
committerAdam <adam@sigterm.info>2014-11-03 23:43:50 -0500
commit527e04275f23ac34d97a91c96b535ad184593e6e (patch)
tree9082653d6124653d4a6c0cae49d4fe0a0cae9534
parentc895bd2e5971b10920870a3b1fcc601fed1df439 (diff)
parent2f004c2aab8eb33afd958b7dfe05cd89703a1129 (diff)
Merge pull request #91 from Alef-Burzmali/2.0+fix-addakiller
Keep the akiller's name when updating the reason.
-rw-r--r--modules/commands/os_akill.cpp6
-rw-r--r--modules/commands/os_sxline.cpp12
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp
index af8573752..fc2558f2c 100644
--- a/modules/commands/os_akill.cpp
+++ b/modules/commands/os_akill.cpp
@@ -153,6 +153,9 @@ class CommandOSAKill : public Command
if (targ)
mask = "*@" + targ->host;
+ 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)
@@ -166,9 +169,6 @@ class CommandOSAKill : public Command
return;
}
- if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty())
- reason = "[" + source.GetNick() + "] " + reason;
-
XLine *x = new XLine(mask, source.GetNick(), expires, reason);
if (Config->GetModule("operserv")->Get<bool>("akillids"))
x->id = XLineManager::GenerateUID();
diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp
index 455422845..6b05ad241 100644
--- a/modules/commands/os_sxline.cpp
+++ b/modules/commands/os_sxline.cpp
@@ -351,6 +351,9 @@ class CommandOSSNLine : public CommandOSSXLineBase
if (mask[masklen - 1] == ' ')
mask.erase(masklen - 1);
+ 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)
@@ -359,9 +362,6 @@ class CommandOSSNLine : public CommandOSSXLineBase
return;
}
- if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty())
- reason = "[" + source.GetNick() + "] " + reason;
-
XLine *x = new XLine(mask, source.GetNick(), expires, reason);
if (Config->GetModule("operserv")->Get<bool>("akillids"))
x->id = XLineManager::GenerateUID();
@@ -558,6 +558,9 @@ 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)
@@ -566,9 +569,6 @@ class CommandOSSQLine : public CommandOSSXLineBase
return;
}
- if (Config->GetModule("operserv")->Get<bool>("addakiller", "yes") && !source.GetNick().empty())
- reason = "[" + source.GetNick() + "] " + reason;
-
XLine *x = new XLine(mask, source.GetNick(), expires, reason);
if (Config->GetModule("operserv")->Get<bool>("akillids"))
x->id = XLineManager::GenerateUID();