From 2f004c2aab8eb33afd958b7dfe05cd89703a1129 Mon Sep 17 00:00:00 2001 From: Thomas Fargeix Date: Fri, 24 Oct 2014 23:45:25 +0200 Subject: Keep the akiller's name when updating the reason. The name of the oper issuing an akill or a sxline could be removed by updating the reason, even though addkiller was enabled. --- modules/commands/os_sxline.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/commands/os_sxline.cpp') 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("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("addakiller", "yes") && !source.GetNick().empty()) - reason = "[" + source.GetNick() + "] " + reason; - XLine *x = new XLine(mask, source.GetNick(), expires, reason); if (Config->GetModule("operserv")->Get("akillids")) x->id = XLineManager::GenerateUID(); @@ -558,6 +558,9 @@ class CommandOSSQLine : public CommandOSSXLineBase } } + if (Config->GetModule("operserv")->Get("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("addakiller", "yes") && !source.GetNick().empty()) - reason = "[" + source.GetNick() + "] " + reason; - XLine *x = new XLine(mask, source.GetNick(), expires, reason); if (Config->GetModule("operserv")->Get("akillids")) x->id = XLineManager::GenerateUID(); -- cgit From afffeb0a1d49c1ac8f06ac9850929a41a52cbc7e Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 5 Dec 2014 17:27:08 -0500 Subject: Update Kill() calls to pass source pointer instead of name --- modules/commands/os_sxline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/commands/os_sxline.cpp') diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 6b05ad241..80b7c5586 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -399,7 +399,7 @@ class CommandOSSNLine : public CommandOSSXLineBase User *user = it->second; if (!user->HasMode("OPER") && user->server != Me && this->xlm()->Check(user, x)) - user->Kill(Me->GetName(), rreason); + user->Kill(Me, rreason); } this->xlm()->Send(NULL, x); @@ -631,7 +631,7 @@ class CommandOSSQLine : public CommandOSSXLineBase User *user = it->second; if (!user->HasMode("OPER") && user->server != Me && this->xlm()->Check(user, x)) - user->Kill(Me->GetName(), rreason); + user->Kill(Me, rreason); } } -- cgit