diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bots.cpp | 8 | ||||
-rw-r--r-- | src/channels.cpp | 20 | ||||
-rw-r--r-- | src/chanserv.cpp | 2 | ||||
-rw-r--r-- | src/misc.cpp | 2 | ||||
-rw-r--r-- | src/nickserv.cpp | 2 | ||||
-rw-r--r-- | src/regchannel.cpp | 17 |
6 files changed, 30 insertions, 21 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 07ea91b3a..1f7b118d8 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -64,6 +64,14 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A BotInfo::~BotInfo() { + // If we're synchronised with the uplink already, send the bot. + if (Me && Me->IsSynced()) + { + ircdproto->SendQuit(this, NULL); + XLine x(this->nick); + ircdproto->SendSQLineDel(&x); + } + for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it) { ChannelInfo *ci = it->second; diff --git a/src/channels.cpp b/src/channels.cpp index 8873931f5..fcd78faed 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -87,6 +87,9 @@ void Channel::Reset() check_modes(this); for (CUserList::const_iterator it = this->users.begin(), it_end = this->users.end(); it != it_end; ++it) chan_set_correct_modes((*it)->user, this, 1); + + if (this->ci) + this->ci->RestoreTopic(); } void Channel::Sync() @@ -117,12 +120,12 @@ void Channel::JoinUser(User *user) uc->Status = Status; this->users.push_back(uc); - bool update_ts = false; if (this->ci && this->ci->HasFlag(CI_PERSIST) && this->creation_time > this->ci->time_registered) { Log(LOG_DEBUG) << "Changing TS of " << this->name << " from " << this->creation_time << " to " << this->ci->time_registered; this->creation_time = this->ci->time_registered; - update_ts = true; + ircdproto->SendChannel(this, ""); + this->Reset(); } if (this->ci && check_access(user, this->ci, CA_MEMO) && this->ci->memos.memos.size() > 0) @@ -142,7 +145,7 @@ void Channel::JoinUser(User *user) * legit users - Rob **/ if (this->users.size() >= Config->BSMinUsers && !this->FindUser(this->ci->bi)) - this->ci->bi->Join(this, update_ts); + this->ci->bi->Join(this, false); /* Only display the greet if the main uplink we're connected * to has synced, or we'll get greet-floods when the net * recovers from a netsplit. -GD @@ -153,17 +156,6 @@ void Channel::JoinUser(User *user) this->ci->bi->lastmsg = Anope::CurTime; } } - - /* Update the TS, unless I'm joining a bot already */ - if (update_ts && user->server != Me) - { - /* Send the updated TS */ - if (!this->FindUser(whosends(this->ci))) - { - whosends(this->ci)->Join(this, update_ts); - whosends(this->ci)->Part(this); - } - } } /** Remove a user internally from the channel diff --git a/src/chanserv.cpp b/src/chanserv.cpp index 35fd8975c..43d4d3b61 100644 --- a/src/chanserv.cpp +++ b/src/chanserv.cpp @@ -273,7 +273,7 @@ void check_modes(Channel *c) } } - else if (cm->Type == MODE_LIST) // XXX we still need better list code... + else if (cm->Type == MODE_LIST) { if (ml.set) c->SetMode(NULL, cm, ml.param); diff --git a/src/misc.cpp b/src/misc.cpp index 97006469a..a8b1d5ca6 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -228,7 +228,7 @@ time_t dotime(const Anope::string &s) } } } - catch (const CoreException &) { } + catch (const ConvertException &) { } return 0; } diff --git a/src/nickserv.cpp b/src/nickserv.cpp index 6212c7d3e..63abf59b3 100644 --- a/src/nickserv.cpp +++ b/src/nickserv.cpp @@ -68,7 +68,7 @@ NickServRelease::~NickServRelease() { NickServReleases.erase(this->nick); - ircdproto->SendQuit(debug_cast<User *>(this), NULL); + ircdproto->SendQuit(this, NULL); } void NickServRelease::Tick(time_t) diff --git a/src/regchannel.cpp b/src/regchannel.cpp index 17c141ea7..7ff3e753a 100644 --- a/src/regchannel.cpp +++ b/src/regchannel.cpp @@ -563,10 +563,19 @@ void ChannelInfo::LoadMLock() if (this->HasFlag(CI_PERSIST) && !this->c) { this->c = new Channel(this->name, this->time_registered); - if (!this->bi && ChanServ && ModeManager::FindChannelModeByName(CMODE_PERM) == NULL) - ChanServ->Assign(NULL, this); - else if (this->bi) - this->bi->Join(c); + if (ModeManager::FindChannelModeByName(CMODE_PERM) != NULL) + { + /* At this point, CMODE_PERM *must* be locked on the channel, so this is fine */ + ircdproto->SendChannel(this->c, get_mlock_modes(this, true)); + } + else + { + if (!this->bi) + whosends(this)->Assign(NULL, this); + if (this->c->FindUser(this->bi) == NULL) + this->bi->Join(this->c); + } + check_modes(this->c); this->CheckTopic(); } |