diff options
author | Adam <Adam@anope.org> | 2011-02-25 21:40:43 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-02-25 21:40:43 -0500 |
commit | ee387569821b45581063f6bc349cccc643f9a293 (patch) | |
tree | 9f8a83e5e9a36304d06c75f2bdf351729ca9bb65 /src/modes.cpp | |
parent | eea7d2eb7715f875096641bae18250122078bd00 (diff) |
Fixed a lot of small problems
Diffstat (limited to 'src/modes.cpp')
-rw-r--r-- | src/modes.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/modes.cpp b/src/modes.cpp index 3a79409a6..14b884896 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -68,36 +68,13 @@ void SetDefaultMLock(ServerConfig *config) } /* Set Bot Modes */ - config->BotModeList.clear(); + config->BotModeList.ClearFlags(); for (unsigned i = 0; i < config->BotModes.length(); ++i) { ChannelMode *cm = ModeManager::FindChannelModeByChar(config->BotModes[i]); - 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 (patricia_tree<BotInfo *, ci::ci_char_traits>::iterator it(BotListByNick); it.next();) - { - BotInfo *bi = *it; - - 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); - } - } + if (cm && cm->Type == MODE_STATUS) + config->BotModeList.SetFlag(cm->Name); } } |