From 723ba8978d6fc9f4ca658ef279039758e5cf2438 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 15 Apr 2024 02:55:53 +0300 Subject: [PATCH] Use messages.affectedMessages.pts even if pts_count == 0. --- td/telegram/MessagesManager.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index dc7376966..66609eb53 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -3726,13 +3726,9 @@ class DeleteMessagesQuery final : public Td::ResultHandler { auto affected_messages = result_ptr.move_as_ok(); LOG(INFO) << "Receive result for DeleteMessagesQuery: " << to_string(affected_messages); - if (affected_messages->pts_count_ > 0) { - td_->updates_manager_->add_pending_pts_update(make_tl_object(), affected_messages->pts_, - affected_messages->pts_count_, Time::now(), std::move(promise_), - "delete messages query"); - } else { - promise_.set_value(Unit()); - } + td_->updates_manager_->add_pending_pts_update(make_tl_object(), affected_messages->pts_, + affected_messages->pts_count_, Time::now(), std::move(promise_), + "delete messages query"); } void on_error(Status status) final { @@ -3778,13 +3774,9 @@ class DeleteChannelMessagesQuery final : public Td::ResultHandler { auto affected_messages = result_ptr.move_as_ok(); LOG(INFO) << "Receive result for DeleteChannelMessagesQuery: " << to_string(affected_messages); - if (affected_messages->pts_count_ > 0) { - td_->messages_manager_->add_pending_channel_update(DialogId(channel_id_), make_tl_object(), - affected_messages->pts_, affected_messages->pts_count_, - std::move(promise_), "DeleteChannelMessagesQuery"); - } else { - promise_.set_value(Unit()); - } + td_->messages_manager_->add_pending_channel_update(DialogId(channel_id_), make_tl_object(), + affected_messages->pts_, affected_messages->pts_count_, + std::move(promise_), "DeleteChannelMessagesQuery"); } void on_error(Status status) final {