diff options
author | Adam <Adam@anope.org> | 2011-08-13 21:52:21 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-09-10 01:52:46 -0400 |
commit | 8a6d6577bd6c9d5ca57c98d932a99ae890ba7cc8 (patch) | |
tree | c3d63ae7797a4c8d08cd7b75ef69a48720a9605d /src/servers.cpp | |
parent | 4a7ba7ef4cd92263d8187b1385d8bf46102ef7b3 (diff) |
Removed log:inhabitlogchannel and replaced it with service:channels
Diffstat (limited to 'src/servers.cpp')
-rw-r--r-- | src/servers.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/servers.cpp b/src/servers.cpp index d1e20e515..dccea8929 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -52,7 +52,7 @@ Server::Server(Server *uplink, const Anope::string &name, unsigned hops, const A /* Check to be sure this isn't a juped server */ if (Me == this->UplinkServer && !this->HasFlag(SERVER_JUPED)) { - /* Load MLock from the database now that we know what modes exist */ + /* Now do mode related stuff as we know what modes exist .. */ for (registered_channel_map::iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it) it->second->LoadMLock(); for (botinfo_map::iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it) @@ -60,6 +60,22 @@ Server::Server(Server *uplink, const Anope::string &name, unsigned hops, const A BotInfo *bi = it->second; Anope::string modes = !bi->botmodes.empty() ? ("+" + bi->botmodes) : ircd->pseudoclient_mode; bi->SetModesInternal(modes.c_str()); + for (unsigned i = 0; i < bi->botchannels.size(); ++i) + { + size_t h = bi->botchannels[i].find('#'); + Anope::string chname = bi->botchannels[i].substr(h != Anope::string::npos ? h : 0); + Channel *c = findchan(chname); + if (c && c->FindUser(bi)) + { + Anope::string want_modes = bi->botchannels[i].substr(0, h); + for (unsigned j = 0; j < want_modes.length(); ++j) + { + ChannelMode *cm = ModeManager::FindChannelModeByChar(ModeManager::GetStatusChar(want_modes[j])); + if (cm && cm->Type == MODE_STATUS) + c->SetModeInternal(cm, bi->nick); + } + } + } } ircdproto->SendBOB(); |