summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/configreader.h4
-rw-r--r--src/configreader.cpp1
-rw-r--r--src/coremods/core_oper/cmd_kill.cpp12
-rw-r--r--src/coremods/core_oper/core_oper.cpp6
-rw-r--r--src/coremods/core_oper/core_oper.h3
5 files changed, 15 insertions, 11 deletions
diff --git a/include/configreader.h b/include/configreader.h
index afe05ccf3..12b154b69 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -397,10 +397,6 @@ class CoreExport ServerConfig
/** Set to a non-empty string to obfuscate server names. */
std::string HideServer;
- /** Set to a non empty string to obfuscate nicknames prepended to a KILL.
- */
- std::string HideKillsServer;
-
/** Set to hide kills from clients of ulined servers in snotices.
*/
bool HideULineKills;
diff --git a/src/configreader.cpp b/src/configreader.cpp
index a8e94586d..c3ef7a1c9 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -412,7 +412,6 @@ void ServerConfig::Fill()
HideSplits = security->getBool("hidesplits");
HideBans = security->getBool("hidebans");
HideServer = security->getString("hideserver", security->getString("hidewhois"));
- HideKillsServer = security->getString("hidekills");
HideULineKills = security->getBool("hideulinekills");
GenericOper = security->getBool("genericoper");
SyntaxHints = options->getBool("syntaxhints");
diff --git a/src/coremods/core_oper/cmd_kill.cpp b/src/coremods/core_oper/cmd_kill.cpp
index 5572e5789..1232ccb46 100644
--- a/src/coremods/core_oper/cmd_kill.cpp
+++ b/src/coremods/core_oper/cmd_kill.cpp
@@ -34,13 +34,13 @@ CommandKill::CommandKill(Module* parent)
class KillMessage : public ClientProtocol::Message
{
public:
- KillMessage(ClientProtocol::EventProvider& protoev, User* user, LocalUser* target, const std::string& text)
+ KillMessage(ClientProtocol::EventProvider& protoev, User* user, LocalUser* target, const std::string& text, const std::string& hidenick)
: ClientProtocol::Message("KILL", NULL)
{
- if (ServerInstance->Config->HideKillsServer.empty())
+ if (hidenick.empty())
SetSourceUser(user);
else
- SetSource(ServerInstance->Config->HideKillsServer);
+ SetSource(hidenick);
PushParamRef(target->nick);
PushParamRef(text);
@@ -87,10 +87,10 @@ CmdResult CommandKill::Handle(User* user, const Params& parameters)
return CMD_FAILURE;
killreason = "Killed (";
- if (!ServerInstance->Config->HideKillsServer.empty())
+ if (!hidenick.empty())
{
// hidekills is on, use it
- killreason += ServerInstance->Config->HideKillsServer;
+ killreason += hidenick;
}
else
{
@@ -117,7 +117,7 @@ CmdResult CommandKill::Handle(User* user, const Params& parameters)
if (IS_LOCAL(target))
{
LocalUser* localu = IS_LOCAL(target);
- KillMessage msg(protoev, user, localu, killreason);
+ KillMessage msg(protoev, user, localu, killreason, hidenick);
ClientProtocol::Event killevent(protoev, msg);
localu->Send(killevent);
diff --git a/src/coremods/core_oper/core_oper.cpp b/src/coremods/core_oper/core_oper.cpp
index a6b2abd81..0da1e1a3a 100644
--- a/src/coremods/core_oper/core_oper.cpp
+++ b/src/coremods/core_oper/core_oper.cpp
@@ -46,6 +46,12 @@ class CoreModOper : public Module
{
}
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+ {
+ ConfigTag* security = ServerInstance->Config->ConfValue("security");
+ cmdkill.hidenick = security->getString("hidekills");
+ }
+
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides the DIE, KILL, OPER, REHASH, and RESTART commands", VF_VENDOR|VF_CORE);
diff --git a/src/coremods/core_oper/core_oper.h b/src/coremods/core_oper/core_oper.h
index db8c4161c..d78f90a83 100644
--- a/src/coremods/core_oper/core_oper.h
+++ b/src/coremods/core_oper/core_oper.h
@@ -63,6 +63,9 @@ class CommandKill : public Command
ClientProtocol::EventProvider protoev;
public:
+ /** Set to a non empty string to obfuscate nicknames prepended to a KILL. */
+ std::string hidenick;
+
/** Constructor for kill.
*/
CommandKill(Module* parent);