| 42 | } |
| 43 | |
| 44 | [[nodiscard]] Data::PremiumSubscriptionOptions GiftCodesFromTL( |
| 45 | const QVector<MTPPremiumGiftCodeOption> &tlOptions) { |
| 46 | auto options = PremiumSubscriptionOptionsFromTL(tlOptions); |
| 47 | for (auto i = 0; i < options.size(); i++) { |
| 48 | const auto &tlOption = tlOptions[i].data(); |
| 49 | const auto currency = qs(tlOption.vcurrency()); |
| 50 | const auto perUserText = Ui::FillAmountAndCurrency( |
| 51 | tlOption.vamount().v / float64(tlOption.vusers().v), |
| 52 | currency, |
| 53 | false); |
| 54 | options[i].costPerMonth = perUserText |
| 55 | + ' ' |
| 56 | + QChar(0x00D7) |
| 57 | + ' ' |
| 58 | + QString::number(tlOption.vusers().v); |
| 59 | options[i].total = Ui::FillAmountAndCurrency( |
| 60 | tlOption.vamount().v, |
| 61 | currency); |
| 62 | options[i].currency = currency; |
| 63 | } |
| 64 | return options; |
| 65 | } |
| 66 | |
| 67 | [[nodiscard]] int FindStarsForResale(const MTPVector<MTPStarsAmount> *list) { |
| 68 | if (!list) { |
no test coverage detected