summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-11-16 09:38:13 -0500
committerAdam <Adam@anope.org>2013-11-16 09:38:13 -0500
commit51a9f64adb2e5fb3c3d9ab1adabd44644727c5b1 (patch)
tree5da437bbe95e9a50a179de9ffaeb173b4243b81a
parent332fd239278fe1a80c500a1ea01763e84783057c (diff)
Use the source's sync state and not mine when processing sjoins to determine whether or not to sync the channel on creation, instead sync it when the server syncs.
-rw-r--r--src/channels.cpp1
-rw-r--r--src/messages.cpp4
-rw-r--r--src/servers.cpp16
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);