aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/StarGift.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-09-25 03:49:17 +0300
committerlevlam <levlam@telegram.org>2025-09-25 03:49:17 +0300
commit1d646c935672c7369b31ea28489345234d1d9999 (patch)
tree3284aff9b364e46caed1af065d1e8ae145e89298 /td/telegram/StarGift.cpp
parentea39d7af6b8de324bb1af7e631669e6a2a98c815 (diff)
Add upgradedGift.colors.
Diffstat (limited to 'td/telegram/StarGift.cpp')
-rw-r--r--td/telegram/StarGift.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/td/telegram/StarGift.cpp b/td/telegram/StarGift.cpp
index 3dbe708ec..5766e5480 100644
--- a/td/telegram/StarGift.cpp
+++ b/td/telegram/StarGift.cpp
@@ -129,6 +129,14 @@ StarGift::StarGift(Td *td, telegram_api::object_ptr<telegram_api::StarGift> &&st
if (star_gift->theme_peer_ != nullptr) {
theme_dialog_id_ = DialogId(star_gift->theme_peer_);
}
+ if (star_gift->peer_color_ != nullptr) {
+ if (star_gift->peer_color_->get_id() == telegram_api::peerColorCollectible::ID) {
+ peer_color_ = PeerColorCollectible::get_peer_color_collectible(
+ telegram_api::move_object_as<telegram_api::peerColorCollectible>(star_gift->peer_color_));
+ } else {
+ LOG(ERROR) << "Receive " << to_string(star_gift->peer_color_);
+ }
+ }
return;
}
if (constructor_id != telegram_api::starGift::ID) {
@@ -207,8 +215,9 @@ td_api::object_ptr<td_api::upgradedGift> StarGift::get_upgraded_gift_object(Td *
!owner_dialog_id_.is_valid() ? nullptr : get_message_sender_object(td, owner_dialog_id_, "upgradedGift owner"),
owner_address_, owner_name_, gift_address_, model_.get_upgraded_gift_model_object(td),
pattern_.get_upgraded_gift_symbol_object(td), backdrop_.get_upgraded_gift_backdrop_object(),
- original_details_.get_upgraded_gift_original_details_object(td), std::move(resale_parameters), value_currency_,
- value_amount_);
+ original_details_.get_upgraded_gift_original_details_object(td),
+ peer_color_ == nullptr ? nullptr : peer_color_->get_upgraded_gift_colors_object(), std::move(resale_parameters),
+ value_currency_, value_amount_);
}
td_api::object_ptr<td_api::giftForResale> StarGift::get_gift_for_resale_object(Td *td) const {
@@ -256,7 +265,8 @@ bool operator==(const StarGift &lhs, const StarGift &rhs) {
lhs.unique_availability_total_ == rhs.unique_availability_total_ &&
lhs.resale_star_count_ == rhs.resale_star_count_ && lhs.resale_ton_count_ == rhs.resale_ton_count_ &&
lhs.regular_gift_id_ == rhs.regular_gift_id_ && lhs.value_currency_ == rhs.value_currency_ &&
- lhs.value_amount_ == rhs.value_amount_ && lhs.theme_dialog_id_ == rhs.theme_dialog_id_;
+ lhs.value_amount_ == rhs.value_amount_ && lhs.theme_dialog_id_ == rhs.theme_dialog_id_ &&
+ lhs.peer_color_ == rhs.peer_color_;
}
StringBuilder &operator<<(StringBuilder &string_builder, const StarGift &star_gift) {