+
+ std::string current;
+ irc::spacesepstream defaultstream(optionstag->getString("exemptchanops"));
+ insp::flat_map<std::string, char> exempts;
+ while (defaultstream.GetToken(current))
+ {
+ std::string::size_type pos = current.find(':');
+ if (pos == std::string::npos || (pos + 2) > current.size())
+ throw ModuleException("Invalid exemptchanops value '" + current + "' at " + optionstag->getTagLocation());
+
+ const std::string restriction = current.substr(0, pos);
+ const char prefix = current[pos + 1];
+
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Exempting prefix %c from %s", prefix, restriction.c_str());
+ exempts[restriction] = prefix;
+ }
+
+ ConfigTag* securitytag = ServerInstance->Config->ConfValue("security");
+ const std::string announceinvites = securitytag->getString("announceinvites", "dynamic");
+ Invite::AnnounceState newannouncestate;
+ if (stdalgo::string::equalsci(announceinvites, "none"))
+ newannouncestate = Invite::ANNOUNCE_NONE;
+ else if (stdalgo::string::equalsci(announceinvites, "all"))
+ newannouncestate = Invite::ANNOUNCE_ALL;
+ else if (stdalgo::string::equalsci(announceinvites, "ops"))
+ newannouncestate = Invite::ANNOUNCE_OPS;
+ else if (stdalgo::string::equalsci(announceinvites, "dynamic"))
+ newannouncestate = Invite::ANNOUNCE_DYNAMIC;
+ else
+ throw ModuleException(announceinvites + " is an invalid <security:announceinvites> value, at " + securitytag->getTagLocation());
+
+ // Config is valid, apply it
+
+ // Validates and applies <maxlist> tags, so do it first
+ banmode.DoRehash();
+
+ exemptions.swap(exempts);
+ // In 2.0 we allowed limits of 0 to be set. This is non-standard behaviour
+ // and will be removed in the next major release.
+ limitmode.minlimit = optionstag->getBool("allowzerolimit", true) ? 0 : 1;;
+ cmdinvite.announceinvites = newannouncestate;
+ joinhook.modefromuser = optionstag->getBool("cyclehostsfromuser");
+