summaryrefslogtreecommitdiff
path: root/src/chanserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-26 23:23:15 -0500
committerAdam <Adam@anope.org>2012-02-26 23:23:15 -0500
commita5b9e235ae240439608aa743c9ebb3bf6e7d342a (patch)
tree9c3040b865ace191c224a94ef525ab60581c6ba5 /src/chanserv.cpp
parenta78790eac4da788a8432d0b83fa72de7853dd697 (diff)
Added chanserv:require config option to set which modes must be on all registered channels. Prevents the core from always enforcing +r on every channel, even if chanserv is not loaded.
Diffstat (limited to 'src/chanserv.cpp')
-rw-r--r--src/chanserv.cpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/chanserv.cpp b/src/chanserv.cpp
index f18c919cc..fd7fb88f9 100644
--- a/src/chanserv.cpp
+++ b/src/chanserv.cpp
@@ -22,89 +22,6 @@ registered_channel_map RegisteredChannelList;
/*************************************************************************/
-/* Check the current modes on a channel; if they conflict with a mode lock,
- * fix them.
- */
-
-void check_modes(Channel *c)
-{
- if (!c)
- {
- Log() << "check_modes called with NULL values";
- return;
- }
-
- if (c->bouncy_modes)
- return;
-
- /* Check for mode bouncing */
- if (c->server_modecount >= 3 && c->chanserv_modecount >= 3)
- {
- Log() << "Warning: unable to set modes on channel " << c->name << ". Are your servers' U:lines configured correctly?";
- c->bouncy_modes = 1;
- return;
- }
-
- if (c->chanserv_modetime != Anope::CurTime)
- {
- c->chanserv_modecount = 0;
- c->chanserv_modetime = Anope::CurTime;
- }
- c->chanserv_modecount++;
-
- /* Check if the channel is registered; if not remove mode -r */
- ChannelInfo *ci = c->ci;
- if (!ci)
- {
- if (c->HasMode(CMODE_REGISTERED))
- c->RemoveMode(NULL, CMODE_REGISTERED);
- return;
- }
-
- for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it)
- {
- const ModeLock &ml = it->second;
- ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name);
- if (!cm)
- continue;
-
- if (cm->Type == MODE_REGULAR)
- {
- if (!c->HasMode(cm->Name) && ml.set)
- c->SetMode(NULL, cm);
- else if (c->HasMode(cm->Name) && !ml.set)
- c->RemoveMode(NULL, cm);
- }
- else if (cm->Type == MODE_PARAM)
- {
- Anope::string param;
- c->GetParam(cm->Name, param);
-
- /* If the channel doesnt have the mode, or it does and it isn't set correctly */
- if (ml.set)
- {
- if (!c->HasMode(cm->Name) || (!param.empty() && !ml.param.empty() && !param.equals_cs(ml.param)))
- c->SetMode(NULL, cm, ml.param);
- }
- else
- {
- if (c->HasMode(cm->Name))
- c->RemoveMode(NULL, cm);
- }
-
- }
- else if (cm->Type == MODE_LIST)
- {
- if (ml.set)
- c->SetMode(NULL, cm, ml.param);
- else
- c->RemoveMode(NULL, cm, ml.param);
- }
- }
-}
-
-/*************************************************************************/
-
ChannelInfo *cs_findchan(const Anope::string &chan)
{
FOREACH_MOD(I_OnFindChan, OnFindChan(chan));