From ef9729fb02dd3e44f59b447b567cdeb450690344 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 14 Mar 2014 22:13:04 -0400 Subject: [PATCH] Mark all channels as syncing when we connect to our uplink. They will finish syncing later when the uplink syncs. Normally the channel state is fully synced here anyway, except if we do not know the modes the uplink has yet. Also fix a related issue with resetting chanels and bouncing modes on our clients, if this is done prior to knowing which modes exist it would silently fail. --- src/channels.cpp | 4 ++++ src/servers.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/channels.cpp b/src/channels.cpp index 86c261029..decc3c77f 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -78,8 +78,12 @@ void Channel::Reset() /* reset modes for my clients */ if (uc->user->server == Me) + { for (size_t i = 0; i < f.Modes().length(); ++i) this->SetMode(NULL, ModeManager::FindChannelModeByChar(f.Modes()[i]), uc->user->GetUID(), false); + /* Modes might not exist yet, so be sure the status is really reset */ + uc->status = f; + } } for (ChanUserList::const_iterator it = this->users.begin(), it_end = this->users.end(); it != it_end; ++it) diff --git a/src/servers.cpp b/src/servers.cpp index 0adeb6727..3f698815c 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -127,6 +127,8 @@ Server::Server(Server *up, const Anope::string &sname, unsigned shops, const Ano if (!c->topic.empty() && !c->topic_setter.empty()) IRCD->SendTopic(c->ci->WhoSends(), c); + + c->syncing = true; } } }