diff options
| author | levlam <levlam@telegram.org> | 2024-12-23 21:49:52 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2024-12-23 21:49:52 +0300 |
| commit | 6c4711e648c9f2ad2644b21dd87b6b41ef9a3d11 (patch) | |
| tree | 2b906277f714d993c668740edf53f87e97c45e3c /td/telegram/StarGiftAttribute.cpp | |
| parent | a41f8d606abc4aba99feeae2abb2f603411074ab (diff) | |
Add td_api::upgradedGiftPatternEmoji.
Diffstat (limited to 'td/telegram/StarGiftAttribute.cpp')
| -rw-r--r-- | td/telegram/StarGiftAttribute.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/td/telegram/StarGiftAttribute.cpp b/td/telegram/StarGiftAttribute.cpp index 43bccbde2..173061ebf 100644 --- a/td/telegram/StarGiftAttribute.cpp +++ b/td/telegram/StarGiftAttribute.cpp @@ -12,24 +12,41 @@ namespace td { -StarGiftAttributeModel::StarGiftAttributeModel( +StarGiftAttributeSticker::StarGiftAttributeSticker( Td *td, telegram_api::object_ptr<telegram_api::starGiftAttributeModel> &&attribute) : name_(std::move(attribute->name_)) , sticker_file_id_(td->stickers_manager_ ->on_get_sticker_document(std::move(attribute->document_), StickerFormat::Unknown, - "StarGiftAttributeModel") + "StarGiftAttributeSticker") .second) , rarity_permille_(attribute->rarity_permille_) { } -td_api::object_ptr<td_api::upgradedGiftModel> StarGiftAttributeModel::get_upgraded_gift_model_object( +StarGiftAttributeSticker::StarGiftAttributeSticker( + Td *td, telegram_api::object_ptr<telegram_api::starGiftAttributePattern> &&attribute) + : name_(std::move(attribute->name_)) + , sticker_file_id_(td->stickers_manager_ + ->on_get_sticker_document(std::move(attribute->document_), StickerFormat::Unknown, + "StarGiftAttributeSticker") + .second) + , rarity_permille_(attribute->rarity_permille_) { +} + +td_api::object_ptr<td_api::upgradedGiftModel> StarGiftAttributeSticker::get_upgraded_gift_model_object( const Td *td) const { CHECK(is_valid()); return td_api::make_object<td_api::upgradedGiftModel>( name_, td->stickers_manager_->get_sticker_object(sticker_file_id_), rarity_permille_); } -bool operator==(const StarGiftAttributeModel &lhs, const StarGiftAttributeModel &rhs) { +td_api::object_ptr<td_api::upgradedGiftPatternEmoji> StarGiftAttributeSticker::get_upgraded_gift_pattern_emoji_object( + const Td *td) const { + CHECK(is_valid()); + return td_api::make_object<td_api::upgradedGiftPatternEmoji>( + name_, td->stickers_manager_->get_sticker_object(sticker_file_id_), rarity_permille_); +} + +bool operator==(const StarGiftAttributeSticker &lhs, const StarGiftAttributeSticker &rhs) { return lhs.name_ == rhs.name_ && lhs.sticker_file_id_ == rhs.sticker_file_id_ && lhs.rarity_permille_ == rhs.rarity_permille_; } |
