From f0aaa7e81adf482f1a27470e2497bcbf54ed248c Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 26 May 2020 01:41:30 +0300 Subject: [PATCH] Init pinned dialog ids in MessagesManager::add_dialog_filter. GitOrigin-RevId: bc93ef811a5674db23900a541b2a57ca17c855fa --- td/telegram/MessagesManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index af4e82261..e0b18db4e 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -15524,6 +15524,15 @@ void MessagesManager::add_dialog_filter(unique_ptr dialog_filter, } } } + + for (auto &input_dialog_id : reversed(dialog_filter->pinned_dialog_ids)) { + auto dialog_id = input_dialog_id.get_dialog_id(); + auto order = get_next_pinned_dialog_order(); + list.pinned_dialogs_.emplace_back(order, dialog_id); + list.pinned_dialog_id_orders_.emplace(dialog_id, order); + } + std::reverse(list.pinned_dialogs_.begin(), list.pinned_dialogs_.end()); + update_list_last_pinned_dialog_date(list); update_list_last_dialog_date(list); }