From 02e7697d02ca9e80e45c922a910131bf81bdac07 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 18 Dec 2019 17:46:02 +0300 Subject: [PATCH] Reload animated emoji sticker set only after getDifference. GitOrigin-RevId: b69b2b4c51f934a2aeb04b7805408acdcf393417 --- td/telegram/AnimationsManager.cpp | 2 +- td/telegram/ContactsManager.cpp | 3 +++ td/telegram/InlineQueriesManager.cpp | 3 +++ td/telegram/StickersManager.cpp | 6 ++++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/td/telegram/AnimationsManager.cpp b/td/telegram/AnimationsManager.cpp index 62530fc1..4b9d7a4f 100644 --- a/td/telegram/AnimationsManager.cpp +++ b/td/telegram/AnimationsManager.cpp @@ -808,7 +808,7 @@ string AnimationsManager::get_animation_search_text(FileId file_id) const { } void AnimationsManager::after_get_difference() { - if (td_->is_online()) { + if (td_->is_online() && !td_->auth_manager_->is_bot()) { get_saved_animations(Auto()); } } diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index c83f97c9..7cacf81b 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -12904,6 +12904,9 @@ UserId ContactsManager::get_support_user(Promise &&promise) { } void ContactsManager::after_get_difference() { + if (td_->auth_manager_->is_bot()) { + return; + } get_user(get_my_id(), 3, Promise()); } diff --git a/td/telegram/InlineQueriesManager.cpp b/td/telegram/InlineQueriesManager.cpp index 153e8bf8..2f8772b9 100644 --- a/td/telegram/InlineQueriesManager.cpp +++ b/td/telegram/InlineQueriesManager.cpp @@ -180,6 +180,9 @@ void InlineQueriesManager::on_drop_inline_query_result_timeout_callback(void *in } void InlineQueriesManager::after_get_difference() { + if (td_->auth_manager_->is_bot()) { + return; + } if (recently_used_bots_loaded_ < 2) { Promise promise; load_recently_used_bots(promise); diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 4e2aaf7c..ce93a45c 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -1100,8 +1100,6 @@ void StickersManager::start_up() { add_sticker_set(animated_emoji_sticker_set_id_, animated_emoji_sticker_set_access_hash_); short_name_to_sticker_set_id_.emplace(animated_emoji_sticker_set_name_, animated_emoji_sticker_set_id_); G()->shared_config().set_option_string("animated_emoji_sticker_set_name", animated_emoji_sticker_set_name_); - - td_->create_handler()->send(); } void StickersManager::tear_down() { @@ -5300,6 +5298,9 @@ string StickersManager::remove_emoji_modifiers(string emoji) { } void StickersManager::after_get_difference() { + if (!td_->auth_manager_->is_bot()) { + return; + } if (td_->is_online()) { get_installed_sticker_sets(false, Auto()); get_installed_sticker_sets(true, Auto()); @@ -5307,6 +5308,7 @@ void StickersManager::after_get_difference() { get_recent_stickers(false, Auto()); get_recent_stickers(true, Auto()); get_favorite_stickers(Auto()); + td_->create_handler()->send(); } }