1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 21:46:39 +02:00

Dont load mlock from the database until after Anope is connected, it doesnt know all of the available modes until then

This commit is contained in:
Adam
2010-05-19 16:59:16 -04:00
committed by Adam
parent 0358ae062b
commit 3a2c2a916a
8 changed files with 115 additions and 79 deletions
+8 -27
View File
@@ -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")
{