diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 1526af795..ca05d738e 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -3502,6 +3502,7 @@ emojis emojis:vector = Emojis; //@name Name of the sticker set //@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@is_created True, if the sticker set is created by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official @@ -3511,7 +3512,7 @@ emojis emojis:vector = Emojis; //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set //@emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_created:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set //@id Identifier of the sticker set @@ -3519,6 +3520,7 @@ stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outli //@name Name of the sticker set //@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@is_created True, if the sticker set is created by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official @@ -3528,7 +3530,7 @@ stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outli //@is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set //@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_created:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index fc5e06aaf..3294ad9c1 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -2516,8 +2516,8 @@ tl_object_ptr StickersManager::get_sticker_set_object(Sticke get_sticker_set_thumbnail_object(sticker_set), get_sticker_minithumbnail(sticker_set->minithumbnail_, sticker_set->id_, -2, get_sticker_set_minithumbnail_zoom(sticker_set)), - sticker_set->is_installed_ && !sticker_set->is_archived_, sticker_set->is_archived_, sticker_set->is_official_, - get_sticker_type_object(sticker_set->sticker_type_), sticker_set->has_text_color_, + sticker_set->is_created_, sticker_set->is_installed_ && !sticker_set->is_archived_, sticker_set->is_archived_, + sticker_set->is_official_, get_sticker_type_object(sticker_set->sticker_type_), sticker_set->has_text_color_, sticker_set->channel_emoji_status_, sticker_set->is_viewed_, std::move(stickers), std::move(emojis)); } @@ -2592,8 +2592,8 @@ tl_object_ptr StickersManager::get_sticker_set_info_obje get_sticker_set_thumbnail_object(sticker_set), get_sticker_minithumbnail(sticker_set->minithumbnail_, sticker_set->id_, -3, get_sticker_set_minithumbnail_zoom(sticker_set)), - sticker_set->is_installed_ && !sticker_set->is_archived_, sticker_set->is_archived_, sticker_set->is_official_, - get_sticker_type_object(sticker_set->sticker_type_), sticker_set->has_text_color_, + sticker_set->is_created_, sticker_set->is_installed_ && !sticker_set->is_archived_, sticker_set->is_archived_, + sticker_set->is_official_, get_sticker_type_object(sticker_set->sticker_type_), sticker_set->has_text_color_, sticker_set->channel_emoji_status_, sticker_set->is_viewed_, sticker_set->was_loaded_ ? actual_count : max(actual_count, sticker_set->sticker_count_), std::move(stickers)); } @@ -3597,6 +3597,7 @@ StickerSetId StickersManager::on_get_sticker_set(tl_object_ptrflags_ & telegram_api::stickerSet::INSTALLED_DATE_MASK) != 0; bool is_archived = set->archived_; bool is_official = set->official_; + bool is_created = set->creator_; bool has_text_color = set->emojis_ && set->text_color_; bool channel_emoji_status = set->emojis_ && set->channel_emoji_status_; StickerType sticker_type = @@ -3635,6 +3636,7 @@ StickerSetId StickersManager::on_get_sticker_set(tl_object_ptrsticker_type_ = sticker_type; s->has_text_color_ = has_text_color; s->channel_emoji_status_ = channel_emoji_status; + s->is_created_ = is_official; s->is_changed_ = true; } else { CHECK(s->id_ == set_id); @@ -3705,6 +3707,10 @@ StickerSetId StickersManager::on_get_sticker_set(tl_object_ptris_official_ = is_official; s->is_changed_ = true; } + if (s->is_created_ != is_created) { + s->is_created_ = is_created; + s->is_changed_ = true; + } if (s->has_text_color_ != has_text_color) { LOG(INFO) << "Needs repainting flag of " << set_id << " changed to " << has_text_color; s->has_text_color_ = has_text_color; @@ -3851,6 +3857,7 @@ StickerSetId StickersManager::on_get_messages_sticker_set(StickerSetId sticker_s s->are_keywords_loaded_ = true; s->is_sticker_has_text_color_loaded_ = true; s->is_sticker_channel_emoji_status_loaded_ = true; + s->is_created_loaded_ = true; FlatHashMap document_id_to_sticker_id; @@ -5403,9 +5410,9 @@ void StickersManager::on_load_sticker_set_from_database(StickerSetId sticker_set << format::as_hex_dump<4>(Slice(value)); } } - if (!sticker_set->is_sticker_channel_emoji_status_loaded_ || !sticker_set->is_sticker_has_text_color_loaded_ || - !sticker_set->are_keywords_loaded_ || !sticker_set->is_thumbnail_reloaded_ || - !sticker_set->are_legacy_sticker_thumbnails_reloaded_) { + if (!sticker_set->is_created_loaded_ || !sticker_set->is_sticker_channel_emoji_status_loaded_ || + !sticker_set->is_sticker_has_text_color_loaded_ || !sticker_set->are_keywords_loaded_ || + !sticker_set->is_thumbnail_reloaded_ || !sticker_set->are_legacy_sticker_thumbnails_reloaded_) { do_reload_sticker_set(sticker_set_id, get_input_sticker_set(sticker_set), 0, Auto(), "on_load_sticker_set_from_database 2"); } diff --git a/td/telegram/StickersManager.h b/td/telegram/StickersManager.h index c1b565b4e..ad7cbc766 100644 --- a/td/telegram/StickersManager.h +++ b/td/telegram/StickersManager.h @@ -476,6 +476,7 @@ class StickersManager final : public Actor { bool are_keywords_loaded_ = false; // stored in telegram_api::messages_stickerSet bool is_sticker_has_text_color_loaded_ = false; bool is_sticker_channel_emoji_status_loaded_ = false; + bool is_created_loaded_ = false; StickerSetId id_; int64 access_hash_ = 0; @@ -497,6 +498,7 @@ class StickersManager final : public Actor { mutable std::map> keyword_stickers_map_; // keyword -> stickers FlatHashMap, FileIdHash> sticker_keywords_map_; // sticker -> keywords + bool is_created_ = false; bool is_installed_ = false; bool is_archived_ = false; bool is_official_ = false; diff --git a/td/telegram/StickersManager.hpp b/td/telegram/StickersManager.hpp index f332b8cab..368fb1ecb 100644 --- a/td/telegram/StickersManager.hpp +++ b/td/telegram/StickersManager.hpp @@ -186,24 +186,26 @@ void StickersManager::store_sticker_set(const StickerSet *sticker_set, bool with STORE_FLAG(is_loaded); STORE_FLAG(sticker_set->is_installed_); STORE_FLAG(sticker_set->is_archived_); - STORE_FLAG(sticker_set->is_official_); + STORE_FLAG(sticker_set->is_official_); // 5 STORE_FLAG(is_masks); STORE_FLAG(sticker_set->is_viewed_); STORE_FLAG(has_expires_at); STORE_FLAG(has_thumbnail); - STORE_FLAG(sticker_set->is_thumbnail_reloaded_); + STORE_FLAG(sticker_set->is_thumbnail_reloaded_); // 10 STORE_FLAG(false); STORE_FLAG(sticker_set->are_legacy_sticker_thumbnails_reloaded_); STORE_FLAG(has_minithumbnail); STORE_FLAG(false); - STORE_FLAG(is_emojis); + STORE_FLAG(is_emojis); // 15 STORE_FLAG(has_thumbnail_document_id); STORE_FLAG(sticker_set->are_keywords_loaded_); STORE_FLAG(sticker_set->is_sticker_has_text_color_loaded_); STORE_FLAG(sticker_set->has_text_color_); - STORE_FLAG(sticker_set->is_sticker_channel_emoji_status_loaded_); + STORE_FLAG(sticker_set->is_sticker_channel_emoji_status_loaded_); // 20 STORE_FLAG(sticker_set->channel_emoji_status_); STORE_FLAG(is_mixed_format); + STORE_FLAG(sticker_set->is_created_); + STORE_FLAG(sticker_set->is_created_loaded_); END_STORE_FLAGS(); store(sticker_set->id_.get(), storer); store(sticker_set->access_hash_, storer); @@ -270,6 +272,8 @@ void StickersManager::parse_sticker_set(StickerSet *sticker_set, ParserT &parser bool has_text_color; bool channel_emoji_status; bool is_mixed_format; + bool is_created; + bool is_created_loaded; BEGIN_PARSE_FLAGS(); PARSE_FLAG(sticker_set->is_inited_); PARSE_FLAG(sticker_set->was_loaded_); @@ -294,6 +298,8 @@ void StickersManager::parse_sticker_set(StickerSet *sticker_set, ParserT &parser PARSE_FLAG(sticker_set->is_sticker_channel_emoji_status_loaded_); PARSE_FLAG(channel_emoji_status); PARSE_FLAG(is_mixed_format); + PARSE_FLAG(is_created); + PARSE_FLAG(is_created_loaded); END_PARSE_FLAGS(); int64 sticker_set_id; int64 access_hash; @@ -357,6 +363,8 @@ void StickersManager::parse_sticker_set(StickerSet *sticker_set, ParserT &parser sticker_set->sticker_type_ = sticker_type; sticker_set->has_text_color_ = has_text_color; sticker_set->channel_emoji_status_ = channel_emoji_status; + sticker_set->is_created_ = is_created; + sticker_set->is_created_loaded_ = is_created_loaded; auto cleaned_username = clean_username(sticker_set->short_name_); if (!cleaned_username.empty()) { @@ -367,7 +375,8 @@ void StickersManager::parse_sticker_set(StickerSet *sticker_set, ParserT &parser 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->has_text_color_ != has_text_color || - sticker_set->channel_emoji_status_ != channel_emoji_status) { + sticker_set->channel_emoji_status_ != channel_emoji_status || sticker_set->is_created_ != is_created || + sticker_set->is_created_loaded_ != is_created_loaded) { sticker_set->is_changed_ = true; } if (sticker_set->short_name_ != short_name) {