MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / GiftCodesFromTL

Function GiftCodesFromTL

Telegram/SourceFiles/api/api_premium.cpp:44–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 2

requestMethod · 0.85
optionsForGiveawayMethod · 0.85

Calls 5

qsFunction · 0.85
FillAmountAndCurrencyFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected