diff options
| author | 2018-07-10 20:32:08 +0100 | |
|---|---|---|
| committer | 2018-07-10 21:01:35 +0100 | |
| commit | 2a022cb9b7ed10d929beb96b6fcc2f1aa6a910f3 (patch) | |
| tree | 9c1b733a6e65f8808a2fcf99cc611ab28b9d3785 /src/configreader.cpp | |
| parent | Use !empty() instead of 'size() > 0' when checking parameter count. (diff) | |
Add a silent option to <options:restrictbannedusers>.
This is useful when dealing with spambots that switch method when
they receive ERR_CANNOTSENDTOCHAN.
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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 <options:restrictbannedusers> 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) |
