summaryrefslogtreecommitdiff
path: root/src/servers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/servers.cpp')
-rw-r--r--src/servers.cpp16
1 files changed, 11 insertions, 5 deletions
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);