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 /src/coremods | |
parent | 680ecdae0c204045d64816a1694fe7481dc382c1 (diff) |
Move <security:hidekills> into core_oper.
Diffstat (limited to 'src/coremods')
-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 |
3 files changed, 15 insertions, 6 deletions
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); |