summaryrefslogtreecommitdiff
path: root/src/coremods/core_channel/core_channel.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-03-31 13:02:57 +0100
committerPeter Powell <petpow@saberuk.com>2018-03-31 13:16:27 +0100
commit802eed1734cf20e9a2549a5fe343d04c34e83a10 (patch)
tree4a9f2a64bd7913934ff014a4240b5fd815f9c39f /src/coremods/core_channel/core_channel.cpp
parentb3a728d93f134684593576f8eaaf2daf8df39340 (diff)
Move <security:announceinvites> to core_channel.
Diffstat (limited to 'src/coremods/core_channel/core_channel.cpp')
-rw-r--r--src/coremods/core_channel/core_channel.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/coremods/core_channel/core_channel.cpp b/src/coremods/core_channel/core_channel.cpp
index a49f8492d..b69483166 100644
--- a/src/coremods/core_channel/core_channel.cpp
+++ b/src/coremods/core_channel/core_channel.cpp
@@ -105,6 +105,19 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
}
exemptions.swap(exempts);
+ ConfigTag* securitytag = ServerInstance->Config->ConfValue("security");
+ const std::string announceinvites = securitytag->getString("announceinvites", "dynamic");
+ if (stdalgo::string::equalsci(announceinvites, "none"))
+ cmdinvite.announceinvites = Invite::ANNOUNCE_NONE;
+ else if (stdalgo::string::equalsci(announceinvites, "all"))
+ cmdinvite.announceinvites = Invite::ANNOUNCE_ALL;
+ else if (stdalgo::string::equalsci(announceinvites, "ops"))
+ cmdinvite.announceinvites = Invite::ANNOUNCE_OPS;
+ else if (stdalgo::string::equalsci(announceinvites, "dynamic"))
+ cmdinvite.announceinvites = Invite::ANNOUNCE_DYNAMIC;
+ else
+ throw ModuleException(announceinvites + " is an invalid <security:announceinvites> value, at " + securitytag->getTagLocation());
+
// 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;