summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-19 16:59:16 -0400
committerAdam <Adam@anope.org>2010-06-18 21:03:44 -0400
commit3a2c2a916a26f4fa1844e71a9f1c2fc25337fd2b (patch)
tree93cb603a579699b51b74a450db092ab8db595e1f /src/core
parent0358ae062b771a3e018ef147f607eae7d0bd8647 (diff)
Dont load mlock from the database until after Anope is connected, it doesnt know all of the available modes until then
Diffstat (limited to 'src/core')
-rw-r--r--src/core/db_plain.cpp35
1 files changed, 8 insertions, 27 deletions
diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp
index 868374813..710d4eb50 100644
--- a/src/core/db_plain.cpp
+++ b/src/core/db_plain.cpp
@@ -793,39 +793,20 @@ class DBPlain : public Module
{
bool Set = key == "MLOCK_ON" ? true : false;
- for (unsigned j = 0; j < params.size(); ++j)
- {
- for (std::list<Mode *>::iterator it = ModeManager::Modes.begin(); it != ModeManager::Modes.end(); ++it)
- {
- if ((*it)->Class == MC_CHANNEL)
- {
- ChannelMode *cm = dynamic_cast<ChannelMode *>(*it);
-
- if (cm->NameAsString == params[j])
- {
- ci->SetMLock(cm->Name, Set);
- }
- }
- }
- }
+ /* For now store mlock in extensible, Anope hasn't yet connected to the IRCd and doesn't know what modes exist */
+ ci->Extend(Set ? "db_mlock_modes_on" : "db_mlock_modes_off", new ExtensibleItemRegular<std::vector<std::string> >(params));
}
else if (key == "MLP")
{
+ std::vector<std::pair<std::string, std::string> > mlp;
+
for (unsigned j = 0; j < params.size(); ++j, ++j)
{
- for (std::list<Mode *>::iterator it = ModeManager::Modes.begin(); it != ModeManager::Modes.end(); ++it)
- {
- if ((*it)->Class == MC_CHANNEL)
- {
- ChannelMode *cm = dynamic_cast<ChannelMode *>(*it);
-
- if (cm->NameAsString == params[j])
- {
- ci->SetMLock(cm->Name, true, params[j + 1]);
- }
- }
- }
+ mlp.push_back(std::make_pair(params[j], params[j + 1]));
}
+
+ /* For now store mlocked modes in extensible, Anope hasn't yet connected to the IRCd and doesn't know what modes exist */
+ ci->Extend("db_mlp", new ExtensibleItemRegular<std::vector<std::pair<std::string, std::string> > >(mlp));
}
else if (key == "MI")
{