diff options
-rw-r--r-- | src/channels.cpp | 1 | ||||
-rw-r--r-- | src/messages.cpp | 4 | ||||
-rw-r--r-- | src/servers.cpp | 16 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 133a58cda..5e3bafa6e 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -90,6 +90,7 @@ void Channel::Reset() void Channel::Sync() { + syncing = false; FOREACH_MOD(OnChannelSync, (this)); } diff --git a/src/messages.cpp b/src/messages.cpp index 0e7d03ce1..8dc962cfd 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -145,10 +145,10 @@ void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, co /* Channel is done syncing */ if (c->syncing) { - c->syncing = false; /* Sync the channel (mode lock, topic, etc) */ /* the channel is synced when the netmerge is complete */ - if (Me && Me->IsSynced()) + Server *src = source.GetServer() ? source.GetServer() : Me; + if (src && src->IsSynced()) c->Sync(); } } diff --git a/src/servers.cpp b/src/servers.cpp index d4c76a217..4bd9746c3 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -257,16 +257,22 @@ void Server::Sync(bool sync_links) this->links[i]->Sync(true); } - if (this->GetUplink() && this->GetUplink() == Me) + bool me = this->GetUplink() && this->GetUplink() == Me; + + if (me) { FOREACH_MOD(OnPreUplinkSync, (this)); + } - for (channel_map::const_iterator it = ChannelList.begin(), it_end = ChannelList.end(); it != it_end; ++it) - { - Channel *c = it->second; + for (channel_map::const_iterator it = ChannelList.begin(), it_end = ChannelList.end(); it != it_end; ++it) + { + Channel *c = it->second; + if (c->syncing) c->Sync(); - } + } + if (me) + { IRCD->SendEOB(); Me->Sync(false); |