1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 01:16:38 +02:00

Set the botmodes on bots in the log channel(s) when using ircds that have dynamic modes

This commit is contained in:
Adam
2010-10-02 15:20:13 -04:00
parent 59f35732f6
commit 8a0cf62d70
2 changed files with 25 additions and 1 deletions
+23
View File
@@ -87,6 +87,29 @@ void SetDefaultMLock(ServerConfig *config)
if (cm && cm->Type == MODE_STATUS && std::find(config->BotModeList.begin(), config->BotModeList.end(), cm) == config->BotModeList.end())
config->BotModeList.push_back(debug_cast<ChannelModeStatus *>(cm));
}
/* Apply the new modes to channels */
for (botinfo_map::const_iterator it = BotListByNick.begin(); it != BotListByNick.end(); ++it)
{
BotInfo *bi = it->second;
for (UChannelList::const_iterator cit = bi->chans.begin(); cit != bi->chans.end(); ++cit)
{
ChannelContainer *cc = *cit;
if (!cc || !cc->chan)
continue;
for (unsigned i = 0; i < config->BotModeList.size(); ++i)
{
if (cc->Status->HasFlag(config->BotModeList[i]->Name))
continue;
cc->Status->SetFlag(config->BotModeList[i]->Name);
cc->chan->SetModeInternal(config->BotModeList[i], bi->nick, false);
}
}
}
}
Anope::string ChannelStatus::BuildCharPrefixList() const