From 48a97d5497328c83b4e7ea704d0ffe1ce6f27b16 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 15 May 2023 14:10:35 +0300 Subject: [PATCH] Resave changed sticker set to database. --- td/telegram/StickersManager.cpp | 3 ++- td/telegram/StickersManager.hpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 3cf6ec38d..4c213ac96 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -5773,9 +5773,10 @@ void StickersManager::on_load_sticker_set_from_database(StickerSetId sticker_set if (with_stickers && old_sticker_count < get_max_featured_sticker_count(sticker_set->sticker_type_) && old_sticker_count < sticker_set->sticker_ids_.size()) { sticker_set->need_save_to_database_ = true; - update_sticker_set(sticker_set, "on_load_sticker_set_from_database"); } + update_sticker_set(sticker_set, "on_load_sticker_set_from_database"); + update_load_requests(sticker_set, with_stickers, Status::OK()); } diff --git a/td/telegram/StickersManager.hpp b/td/telegram/StickersManager.hpp index 9e59a0cb7..2e82cb82d 100644 --- a/td/telegram/StickersManager.hpp +++ b/td/telegram/StickersManager.hpp @@ -354,15 +354,19 @@ void StickersManager::parse_sticker_set(StickerSet *sticker_set, ParserT &parser } on_update_sticker_set(sticker_set, is_installed, is_archived, false, true); } else { - if (sticker_set->title_ != title) { - LOG(INFO) << "Title of " << sticker_set->id_ << " has changed"; + if (sticker_set->title_ != title || sticker_set->minithumbnail_ != minithumbnail || + sticker_set->thumbnail_ != thumbnail || sticker_set->thumbnail_document_id_ != thumbnail_document_id || + sticker_set->is_official_ != is_official) { + sticker_set->is_changed_ = true; } if (sticker_set->short_name_ != short_name) { LOG(INFO) << "Short name of " << sticker_set->id_ << " has changed from \"" << short_name << "\" to \"" << sticker_set->short_name_ << "\""; + sticker_set->is_changed_ = true; } if (sticker_set->sticker_count_ != sticker_count || sticker_set->hash_ != hash) { sticker_set->is_loaded_ = false; + sticker_set->is_changed_ = true; } if (sticker_set->sticker_format_ != sticker_format) { LOG(ERROR) << "Sticker format of " << sticker_set->id_ << " has changed from \"" << sticker_format << "\" to \""