From 5dfa6598c2aaf0e1b64315b7869a2e7d5e357fe1 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 14 Feb 2014 11:09:53 -0500 Subject: [PATCH] Do not sync channels in Channel::Reset if they are in the middle of syncing, and checkmodes in Channel::Sync. Fixes channel modes sometimes not being set if always_lower_ts is on --- src/channels.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/channels.cpp b/src/channels.cpp index 072634253..27e186b83 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -85,13 +85,17 @@ void Channel::Reset() for (ChanUserList::const_iterator it = this->users.begin(), it_end = this->users.end(); it != it_end; ++it) this->SetCorrectModes(it->second->user, true); - this->Sync(); + // If the channel is syncing now, do not force a sync due to Reset(), as we are probably iterating over users in Message::SJoin + // A sync will come soon + if (!syncing) + this->Sync(); } void Channel::Sync() { syncing = false; FOREACH_MOD(OnChannelSync, (this)); + CheckModes(); } void Channel::CheckModes()