diff options
| author | levlam <levlam@telegram.org> | 2025-02-19 15:29:16 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2025-02-19 15:29:16 +0300 |
| commit | 5f7d1157c06d525d7f47cad87a4817f8df17357a (patch) | |
| tree | d75ace91a33d1fe4ff6d3bfdf19819176e9ec846 /td/telegram/Premium.cpp | |
| parent | c3985d11a492b394df43557c174039ad3a3082a5 (diff) | |
Sort premium gift options by duration.
Diffstat (limited to 'td/telegram/Premium.cpp')
| -rw-r--r-- | td/telegram/Premium.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/td/telegram/Premium.cpp b/td/telegram/Premium.cpp index 9a5af6b27..d0620cc25 100644 --- a/td/telegram/Premium.cpp +++ b/td/telegram/Premium.cpp @@ -425,6 +425,8 @@ class GetPremiumGiftOptionsQuery final : public Td::ResultHandler { static_cast<int32>(100 * (1.0 - relative_price)), result->months_, result->store_product_, td_->stickers_manager_->get_premium_gift_sticker_object(result->months_, 0))); } + std::sort(options.begin(), options.end(), + [](const auto &lhs, const auto &rhs) { return lhs->month_count_ < rhs->month_count_; }); promise_.set_value(td_api::make_object<td_api::premiumGiftPaymentOptions>(std::move(options))); } |
