diff options
author | Peter Powell <petpow@saberuk.com> | 2018-10-01 16:31:15 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-10-01 17:26:22 +0100 |
commit | 7b6f7dcde5f077717a3bd665d269766a966243b0 (patch) | |
tree | ff653533d7ee9c13aaa67b2b765b7fe97336b9ac | |
parent | 680ecdae0c204045d64816a1694fe7481dc382c1 (diff) |
Move <security:hidekills> into core_oper.
-rw-r--r-- | include/configreader.h | 4 | ||||
-rw-r--r-- | src/configreader.cpp | 1 | ||||
-rw-r--r-- | src/coremods/core_oper/cmd_kill.cpp | 12 | ||||
-rw-r--r-- | src/coremods/core_oper/core_oper.cpp | 6 | ||||
-rw-r--r-- | src/coremods/core_oper/core_oper.h | 3 |
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); |