summaryrefslogtreecommitdiff
path: root/modules/commands
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 /modules/commands
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 'modules/commands')
-rw-r--r--modules/commands/cs_clone.cpp2
-rw-r--r--modules/commands/cs_drop.cpp7
-rw-r--r--modules/commands/cs_mode.cpp2
-rw-r--r--modules/commands/cs_register.cpp12
-rw-r--r--modules/commands/cs_set_persist.cpp7
5 files changed, 14 insertions, 16 deletions
diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp
index 8205b723c..1676c70f6 100644
--- a/modules/commands/cs_clone.cpp
+++ b/modules/commands/cs_clone.cpp
@@ -67,7 +67,7 @@ public:
{
target_ci->c->ci = target_ci;
- check_modes(target_ci->c);
+ target_ci->c->CheckModes();
ChannelMode *cm;
if (u->FindChannel(target_ci->c) != NULL)
diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp
index e9736851a..abdbed17e 100644
--- a/modules/commands/cs_drop.cpp
+++ b/modules/commands/cs_drop.cpp
@@ -53,16 +53,17 @@ class CommandCSDrop : public Command
return;
}
- if (ci->c && ModeManager::FindChannelModeByName(CMODE_REGISTERED))
- ci->c->RemoveMode(NULL, CMODE_REGISTERED, "", false);
-
bool override = (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !ci->AccessFor(u).HasPriv("FOUNDER"));
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "(founder was: " << (ci->GetFounder() ? ci->GetFounder()->display : "none") << ")";
+ Channel *c = ci->c;
delete ci;
source.Reply(_("Channel \002%s\002 has been dropped."), chan.c_str());
+ if (c)
+ c->CheckModes();
+
FOREACH_MOD(I_OnChanDrop, OnChanDrop(chan));
return;
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index c2b9c7de4..c9d7c112a 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -96,7 +96,7 @@ class CommandCSMode : public Command
}
if (ci->c)
- check_modes(ci->c);
+ ci->c->CheckModes();
}
else if (subcommand.equals_ci("DEL") && !param.empty())
{
diff --git a/modules/commands/cs_register.cpp b/modules/commands/cs_register.cpp
index 633364d31..570fd8125 100644
--- a/modules/commands/cs_register.cpp
+++ b/modules/commands/cs_register.cpp
@@ -76,7 +76,7 @@ class CommandCSRegister : public Command
/* Implement new mode lock */
if (c)
{
- check_modes(c);
+ c->CheckModes();
ChannelMode *cm;
if (u->FindChannel(c) != NULL)
@@ -138,16 +138,6 @@ class CSRegister : public Module
commandcsregister(this)
{
this->SetAuthor("Anope");
-
- ModuleManager::Attach(I_OnDelChan, this);
- }
-
- void OnDelChan(ChannelInfo *ci) anope_override
- {
- if (ci->c && ci->c->HasMode(CMODE_REGISTERED))
- ci->c->RemoveMode(NULL, CMODE_REGISTERED, "", false);
- if (ci->c && ci->HasFlag(CI_PERSIST))
- ci->c->RemoveMode(NULL, CMODE_PERM, "", false);
}
};
diff --git a/modules/commands/cs_set_persist.cpp b/modules/commands/cs_set_persist.cpp
index 4a1d676dd..b9d4d2c35 100644
--- a/modules/commands/cs_set_persist.cpp
+++ b/modules/commands/cs_set_persist.cpp
@@ -172,6 +172,13 @@ class CSSetPersist : public Module
{
this->SetAuthor("Anope");
+ ModuleManager::Attach(I_OnDelChan, this);
+ }
+
+ void OnDelChan(ChannelInfo *ci) anope_override
+ {
+ if (ci->c && ci->HasFlag(CI_PERSIST))
+ ci->c->RemoveMode(NULL, CMODE_PERM, "", false);
}
};