From 2a022cb9b7ed10d929beb96b6fcc2f1aa6a910f3 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 10 Jul 2018 20:32:08 +0100 Subject: Add a silent option to . This is useful when dealing with spambots that switch method when they receive ERR_CANNOTSENDTOCHAN. --- src/configreader.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index c9fa62510..b5d6b3ecb 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -434,7 +434,6 @@ void ServerConfig::Fill() HideServer = security->getString("hideserver", security->getString("hidewhois")); HideKillsServer = security->getString("hidekills"); HideULineKills = security->getBool("hideulinekills"); - RestrictBannedUsers = security->getBool("restrictbannedusers", true); GenericOper = security->getBool("genericoper"); SyntaxHints = options->getBool("syntaxhints"); CycleHostsFromUser = options->getBool("cyclehostsfromuser"); @@ -474,6 +473,16 @@ void ServerConfig::Fill() ReadXLine(this, "badhost", "host", ServerInstance->XLines->GetFactory("K")); ReadXLine(this, "exception", "host", ServerInstance->XLines->GetFactory("E")); + const std::string restrictbannedusers = options->getString("restrictbannedusers", "yes"); + if (stdalgo::string::equalsci(restrictbannedusers, "no")) + RestrictBannedUsers = ServerConfig::BUT_NORMAL; + else if (stdalgo::string::equalsci(restrictbannedusers, "silent")) + RestrictBannedUsers = ServerConfig::BUT_RESTRICT_SILENT; + else if (stdalgo::string::equalsci(restrictbannedusers, "yes")) + RestrictBannedUsers = ServerConfig::BUT_RESTRICT_NOTIFY; + else + throw CoreException(restrictbannedusers + " is an invalid value, at " + options->getTagLocation()); + DisabledUModes.reset(); std::string modes = ConfValue("disabled")->getString("usermodes"); for (std::string::const_iterator p = modes.begin(); p != modes.end(); ++p) -- cgit v1.3.1-10-gc9f91