From 91f8bb48ac9507439993919461ed470b6268e051 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 27 Jul 2021 01:46:22 +0300 Subject: [PATCH] Improve condition for channelDifference. --- td/telegram/MessagesManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index d4f69db8c..b87c373a4 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -7364,7 +7364,8 @@ void MessagesManager::add_pending_channel_update(DialogId dialog_id, tl_object_p if (old_pts != new_pts - pts_count) { LOG(INFO) << "Found a gap in the " << dialog_id << " with pts = " << old_pts << ". new_pts = " << new_pts << ", pts_count = " << pts_count << " in update from " << source; - if (d->order != DEFAULT_ORDER || is_dialog_sponsored(d) || d->was_opened) { + if (d->was_opened || td_->contacts_manager_->get_channel_status(channel_id).is_member() || + is_dialog_sponsored(d)) { d->postponed_channel_updates.emplace( new_pts, PendingPtsUpdate(std::move(update), new_pts, pts_count, std::move(promise))); @@ -22871,6 +22872,8 @@ MessagesManager::Message *MessagesManager::get_message_to_send( : get_next_yet_unsent_message_id(d); LOG(INFO) << "Create " << message_id << " in " << dialog_id; + d->was_opened = true; + auto dialog_type = dialog_id.get_type(); auto my_id = td_->contacts_manager_->get_my_id();