From d0fc6930e4bccd6e18a937d182748e209dca75c4 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 1 Feb 2019 16:43:55 +0300 Subject: [PATCH] Fix updateing pinned message. GitOrigin-RevId: 55d651c182c379f194f3cd8fbbbfab47b3d3e9e4 --- 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 e7b39726..7898785d 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -11593,6 +11593,9 @@ MessageId MessagesManager::get_dialog_pinned_message(DialogId dialog_id, Promise return MessageId(); } + LOG(INFO) << "Get pinned message in " << dialog_id << " with " + << (d->is_pinned_message_id_inited ? "inited" : "unknown") << " pinned " << d->pinned_message_id; + Promise empty_promise; auto &get_pinned_message_id_promise = d->is_pinned_message_id_inited ? empty_promise : promise; switch (dialog_id.get_type()) { @@ -21643,7 +21646,7 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq m->sender_user_id == my_user_id); } } - if (from_update && message_id.is_server()) { + if (from_update && message_id.is_server() && message_content_type == MessageContentType::PinMessage) { auto pinned_message_id = get_message_content_pinned_message_id(m->content.get()); on_update_dialog_pinned_message_id(dialog_id, pinned_message_id); }