summaryrefslogtreecommitdiff
path: root/src/bots.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-08-21 01:40:36 -0400
committerAdam <Adam@anope.org>2010-08-21 01:40:36 -0400
commitfb551f0d5d412246a5221e8e9e310c191033b317 (patch)
treee737cdf9db93d53313701695c338ab9c96e83e9f /src/bots.cpp
parent931b0777fbd961a4ca961ddfa763af92dcce946c (diff)
Made Anope keep track of channels its clients are in if it splits from its uplink, then burst them back to its uplink once connection is reestablished.
Also made Anope use TS enforcement to change persistant channels creation time to the time they were registered.
Diffstat (limited to 'src/bots.cpp')
-rw-r--r--src/bots.cpp34
1 files changed, 27 insertions, 7 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index cb7a370c1..d63f6787f 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -49,7 +49,7 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
if (!this->uid.empty())
BotListByUID[this->uid] = this;
- // If we're synchronised with the uplink already, call introduce_user() for this bot.
+ // If we're synchronised with the uplink already, send the bot.
if (Me && !Me->GetLinks().empty() && Me->GetLinks().front()->IsSynced())
{
ircdproto->SendClientIntroduction(this->nick, this->GetIdent(), this->host, this->realname, ircd->pseudoclient_mode, this->uid);
@@ -136,7 +136,7 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci)
ci->bi = NULL;
}
-void BotInfo::Join(Channel *c)
+void BotInfo::Join(Channel *c, bool update_ts)
{
if (Config->BSSmartJoin)
{
@@ -162,19 +162,39 @@ void BotInfo::Join(Channel *c)
if (c->HasMode(CMODE_INVITE) || (limit && c->users.size() >= limit))
ircdproto->SendNoticeChanops(this, c, "%s invited %s into the channel.", this->nick.c_str(), this->nick.c_str());
}
+
+ ModeManager::ProcessModes();
}
- ircdproto->SendJoin(this, c->name, c->creation_time);
- for (std::list<ChannelModeStatus *>::iterator it = BotModes.begin(), it_end = BotModes.end(); it != it_end; ++it)
- c->SetMode(this, *it, this->nick, false);
c->JoinUser(this);
+ ChannelContainer *cc = this->FindChannel(c);
+ for (std::list<ChannelModeStatus *>::iterator it = BotModes.begin(), it_end = BotModes.end(); it != it_end; ++it)
+ {
+ if (!update_ts)
+ {
+ c->SetMode(this, *it, this->nick, false);
+ }
+ else
+ {
+ cc->Status->SetFlag((*it)->Name);
+ c->SetModeInternal(*it, this->nick, false);
+ }
+ }
+ if (!update_ts)
+ ircdproto->SendJoin(this, c->name, c->creation_time);
+ else
+ {
+ ircdproto->SendJoin(this, cc);
+
+ c->Reset();
+ }
FOREACH_MOD(I_OnBotJoin, OnBotJoin(c->ci, this));
}
-void BotInfo::Join(const Anope::string &chname)
+void BotInfo::Join(const Anope::string &chname, bool update_ts)
{
Channel *c = findchan(chname);
- return this->Join(c ? c : new Channel(chname));
+ return this->Join(c ? c : new Channel(chname), update_ts);
}
void BotInfo::Part(Channel *c, const Anope::string &reason)