From 542c4d374dcc2f1ce94fcbe39549d3019ada98cc Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 12 Apr 2019 01:03:27 +0300 Subject: [PATCH] Do not preload pinned message for bots. GitOrigin-RevId: 5d260435a24af21394e133275d01f6e93c7adbeb --- td/telegram/MessagesManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 2bb463c8a..4eb965cc6 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -10635,7 +10635,7 @@ void MessagesManager::on_get_dialogs(vector> << dialog_id; dialog->unread_mentions_count_ = 0; } - if (!d->is_pinned_message_id_inited) { + if (!d->is_pinned_message_id_inited && !td_->auth_manager_->is_bot()) { // asynchronously get dialog pinned message from the server // TODO add pinned_message_id to telegram_api::dialog get_dialog_pinned_message(dialog_id, Auto()); @@ -23736,7 +23736,8 @@ void MessagesManager::fix_new_dialog(Dialog *d, unique_ptr &&last_datab } if (being_added_dialog_id_ != dialog_id && !d->is_pinned_message_id_inited && - (d->dialog_id == get_my_dialog_id() || d->dialog_id.get_type() != DialogType::User)) { + (d->dialog_id == get_my_dialog_id() || d->dialog_id.get_type() != DialogType::User) && + !td_->auth_manager_->is_bot()) { // asynchronously get dialog pinned message from the server get_dialog_pinned_message(dialog_id, Auto()); }