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/bots.cpp | |
parent | 4a7ba7ef4cd92263d8187b1385d8bf46102ef7b3 (diff) |
Removed log:inhabitlogchannel and replaced it with service:channels
Diffstat (limited to 'src/bots.cpp')
-rw-r--r-- | src/bots.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index b794610e6..379836ec2 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -38,32 +38,6 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A XLine x(this->nick, "Reserved for services"); ircdproto->SendSQLine(NULL, &x); } - - if (Config) - for (unsigned i = 0; i < Config->LogInfos.size(); ++i) - { - LogInfo *l = Config->LogInfos[i]; - - if (ircd && !ircd->join2msg && !l->Inhabit) - continue; - - for (std::list<Anope::string>::const_iterator sit = l->Targets.begin(), sit_end = l->Targets.end(); sit != sit_end; ++sit) - { - const Anope::string &target = *sit; - - if (target[0] == '#') - { - Channel *c = findchan(target); - if (!c) - c = new Channel(target); - c->SetFlag(CH_LOGCHAN); - c->SetFlag(CH_PERSIST); - - if (!c->FindUser(this)) - this->Join(c, &Config->BotModeList); - } - } - } } BotInfo::~BotInfo() @@ -160,6 +134,9 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci) void BotInfo::Join(Channel *c, ChannelStatus *status) { + if (c->FindUser(this) != NULL) + return; + if (Config && ircdproto && Config->BSSmartJoin) { std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = c->GetModeList(CMODE_BAN); @@ -199,6 +176,9 @@ void BotInfo::Join(const Anope::string &chname, ChannelStatus *status) void BotInfo::Part(Channel *c, const Anope::string &reason) { + if (c->FindUser(this) == NULL) + return; + ircdproto->SendPart(this, c, "%s", !reason.empty() ? reason.c_str() : ""); c->DeleteUser(this); } |