From f80798f2c15d27d3f98f5323e69c5b9ff2aaa48b Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 25 Feb 2016 08:37:46 -0500 Subject: Don't show snotices for kills from ulined clients --- docs/conf/inspircd.conf.example | 3 +++ include/configreader.h | 4 ++++ src/commands/cmd_kill.cpp | 14 +++++++++----- src/configreader.cpp | 1 + 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index 9fd0adfd3..7099cefe2 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -695,6 +695,9 @@ # hidekills: If defined, replaces who set a /kill with a custom string. hidekills="" + # hideulinekills: Hide kills from clients of ulined servers from server notices. + hideulinekills="yes" + # hidesplits: If enabled, non-opers will not be able to see which # servers split in a netsplit, they will only be able to see that one # occurred (If their client has netsplit detection). diff --git a/include/configreader.h b/include/configreader.h index b01a979a7..4a697d05c 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -438,6 +438,10 @@ class CoreExport ServerConfig */ std::string HideKillsServer; + /** Set to hide kills from clients of ulined servers in snotices. + */ + bool HideULineKills; + /** The full pathname and filename of the PID * file as defined in the configuration. */ diff --git a/src/commands/cmd_kill.cpp b/src/commands/cmd_kill.cpp index 99ac39d42..7bdf32c74 100644 --- a/src/commands/cmd_kill.cpp +++ b/src/commands/cmd_kill.cpp @@ -111,7 +111,8 @@ CmdResult CommandKill::Handle (const std::vector& parameters, User if (!IS_LOCAL(u)) { // remote kill - ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str()); + if (!ServerInstance->Config->HideULineKills || !ServerInstance->ULine(user->server)) + ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str()); FOREACH_MOD(I_OnRemoteKill, OnRemoteKill(user, u, killreason, killreason)); } else @@ -121,10 +122,13 @@ CmdResult CommandKill::Handle (const std::vector& parameters, User * XXX - this isn't entirely correct, servers A - B - C, oper on A, client on C. Oper kills client, A and B will get remote kill * snotices, C will get a local kill snotice. this isn't accurate, and needs fixing at some stage. -- w00t */ - if (IS_LOCAL(user)) - ServerInstance->SNO->WriteGlobalSno('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str()); - else - ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str()); + if (!ServerInstance->Config->HideULineKills || !ServerInstance->ULine(user->server)) + { + if (IS_LOCAL(user)) + ServerInstance->SNO->WriteGlobalSno('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str()); + else + ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str()); + } ServerInstance->Logs->Log("KILL",DEFAULT,"LOCAL KILL: %s :%s!%s!%s (%s)", u->nick.c_str(), ServerInstance->Config->ServerName.c_str(), user->dhost.c_str(), user->nick.c_str(), parameters[1].c_str()); /* Bug #419, make sure this message can only occur once even in the case of multiple KILL messages crossing the network, and change to show * hidekillsserver as source if possible diff --git a/src/configreader.cpp b/src/configreader.cpp index bcee938d5..5b298ddd8 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -531,6 +531,7 @@ void ServerConfig::Fill() HideBans = security->getBool("hidebans"); HideWhoisServer = security->getString("hidewhois"); HideKillsServer = security->getString("hidekills"); + HideULineKills = security->getBool("hideulinekills"); RestrictBannedUsers = security->getBool("restrictbannedusers", true); GenericOper = security->getBool("genericoper"); NoUserDns = ConfValue("performance")->getBool("nouserdns"); -- cgit v1.2.3