- /* Our TS greater than theirs, clear all our modes from the channel, accept theirs. */
- ServerInstance->SNO->WriteToSnoMask('d', "Removing our modes, accepting remote");
- std::deque<std::string> param_list;
- if (Utils->AnnounceTSChange && chan)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name.c_str(), chan->name.c_str(), (unsigned long) ourTS, (unsigned long) TS);
- ourTS = TS;
- chan->age = TS;
- param_list.push_back(channel);
- this->RemoveStatus(ServerInstance->Config->GetSID(), param_list);
- }
- else
- {
- /* Timestamp equal. Apply the user modes always */
- apply_other_sides_umodes = true;
- /*
- * If the server is bursting, then the channel modes need to be applied;
- * it is expected that servers will resync modes at this time. Otherwise,
- * the mode string sent along with the FJOIN could be out-of-date, and
- * applying the mode change could cause modes to be unexpectedly bounced.
- */
- TreeServer *s = Utils->FindServer(source);
- apply_other_sides_cmodes = s->bursting;
- }
- }
+ ServerInstance->SNO->WriteToSnoMask('d', "Merge FJOIN received for %s, ourTS: %lu, TS: %lu, difference: %lu",
+ chan->name.c_str(), (unsigned long)ourTS, (unsigned long)TS, (unsigned long)(ourTS - TS));
+ /* If our TS is less than theirs, we dont accept their modes */
+ if (ourTS < TS)
+ {
+ apply_other_sides_modes = false;
+ }
+ else if (ourTS > TS)
+ {
+ /* Our TS greater than theirs, clear all our modes from the channel, accept theirs. */
+ if (Utils->AnnounceTSChange)
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name.c_str(), channel.c_str(), (unsigned long) ourTS, (unsigned long) TS);