diff options
-rw-r--r-- | src/bots.cpp | 3 | ||||
-rw-r--r-- | src/modes.cpp | 23 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index be580c2a0..fbb5de3c7 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -169,7 +169,7 @@ void BotInfo::Join(Channel *c, bool update_ts) c->JoinUser(this); ChannelContainer *cc = this->FindChannel(c); - for (int i = 0; i < Config->BotModeList.size(); ++i) + for (unsigned i = 0; i < Config->BotModeList.size(); ++i) { if (!update_ts) { @@ -183,6 +183,7 @@ void BotInfo::Join(Channel *c, bool update_ts) } if (!update_ts) ircdproto->SendJoin(this, c->name, c->creation_time); + /* This is sent later, when we burst to the uplink */ else if (Me && Me->IsSynced()) { ircdproto->SendJoin(this, cc); 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 |