summaryrefslogtreecommitdiff
path: root/src/modes.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-10-02 15:20:13 -0400
committerAdam <Adam@anope.org>2010-10-02 15:24:00 -0400
commit8a0cf62d703a7e4b15c2d04d9d38e1b58165ef4d (patch)
tree5ff74a0a90dd62d44cd20b0c5419e45db4faedd8 /src/modes.cpp
parent59f35732f66456cca9e459134f926d8b8c17f469 (diff)
Set the botmodes on bots in the log channel(s) when using ircds that have dynamic modes
Diffstat (limited to 'src/modes.cpp')
-rw-r--r--src/modes.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/modes.cpp b/src/modes.cpp
index 0405cf998..16bb1590b 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -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