]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_channel/core_channel.cpp
Merge branch 'insp20' into master.
[user/henk/code/inspircd.git] / src / coremods / core_channel / core_channel.cpp
index a49f8492d7daa8140acb29bf3a813246c1335641..ccf4d1a6e1c64695b1ecf1a632054066036bbed5 100644 (file)
@@ -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;
@@ -256,6 +269,7 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
        void Prioritize() CXX11_OVERRIDE
        {
                ServerInstance->Modules.SetPriority(this, I_OnPostJoin, PRIORITY_FIRST);
+               ServerInstance->Modules.SetPriority(this, I_OnUserPreJoin, PRIORITY_LAST);
        }
 
        Version GetVersion() CXX11_OVERRIDE