From b5abe4b751fba9c6a6f35296551ee9401a7bb53a Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 28 Nov 2018 04:00:39 +0300 Subject: [PATCH] Possibly better handling of wrong is_outgoing flag. GitOrigin-RevId: a53999ddb5aee83b2a737364ab07c2906b5b84fb --- td/telegram/MessagesManager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 9c1c35d0..b0f98189 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -9391,6 +9391,16 @@ std::pair> MessagesManager::creat << ", flags = " << flags << " for " << message_id << " in " << dialog_id; // } is_outgoing = !is_outgoing; + + if (dialog_type == DialogType::Channel && !running_get_difference_ && !running_get_channel_difference(dialog_id) && + get_channel_difference_to_logevent_id_.count(dialog_id) == 0) { + // it is safer to completely ignore the message and re-get it through getChannelsDifference + Dialog *d = get_dialog(dialog_id); + if (d != nullptr) { + get_channel_difference(dialog_id, d->pts, true, "create_message"); + return {DialogId(), nullptr}; + } + } } MessageId reply_to_message_id = message_info.reply_to_message_id;