Resave changed sticker set to database.

This commit is contained in:
levlam 2023-05-15 14:10:35 +03:00
parent 012424074b
commit 48a97d5497
2 changed files with 8 additions and 3 deletions

View File

@ -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_) && if (with_stickers && old_sticker_count < get_max_featured_sticker_count(sticker_set->sticker_type_) &&
old_sticker_count < sticker_set->sticker_ids_.size()) { old_sticker_count < sticker_set->sticker_ids_.size()) {
sticker_set->need_save_to_database_ = true; 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()); update_load_requests(sticker_set, with_stickers, Status::OK());
} }

View File

@ -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); on_update_sticker_set(sticker_set, is_installed, is_archived, false, true);
} else { } else {
if (sticker_set->title_ != title) { if (sticker_set->title_ != title || sticker_set->minithumbnail_ != minithumbnail ||
LOG(INFO) << "Title of " << sticker_set->id_ << " has changed"; 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) { if (sticker_set->short_name_ != short_name) {
LOG(INFO) << "Short name of " << sticker_set->id_ << " has changed from \"" << short_name << "\" to \"" LOG(INFO) << "Short name of " << sticker_set->id_ << " has changed from \"" << short_name << "\" to \""
<< sticker_set->short_name_ << "\""; << sticker_set->short_name_ << "\"";
sticker_set->is_changed_ = true;
} }
if (sticker_set->sticker_count_ != sticker_count || sticker_set->hash_ != hash) { if (sticker_set->sticker_count_ != sticker_count || sticker_set->hash_ != hash) {
sticker_set->is_loaded_ = false; sticker_set->is_loaded_ = false;
sticker_set->is_changed_ = true;
} }
if (sticker_set->sticker_format_ != sticker_format) { if (sticker_set->sticker_format_ != sticker_format) {
LOG(ERROR) << "Sticker format of " << sticker_set->id_ << " has changed from \"" << sticker_format << "\" to \"" LOG(ERROR) << "Sticker format of " << sticker_set->id_ << " has changed from \"" << sticker_format << "\" to \""