2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Added ability to request credits subscriptions with missing balance.

This commit is contained in:
23rd
2025-04-13 13:42:27 +03:00
committed by John Preston
parent 5886a07300
commit eb3419f3fc
2 changed files with 7 additions and 3 deletions

View File

@@ -348,12 +348,15 @@ void CreditsHistory::request(
void CreditsHistory::requestSubscriptions(
const Data::CreditsStatusSlice::OffsetToken &token,
Fn<void(Data::CreditsStatusSlice)> done) {
Fn<void(Data::CreditsStatusSlice)> done,
bool missingBalance) {
if (_requestId) {
return;
}
_requestId = _api.request(MTPpayments_GetStarsSubscriptions(
MTP_flags(0),
MTP_flags(missingBalance
? MTPpayments_getStarsSubscriptions::Flag::f_missing_balance
: MTPpayments_getStarsSubscriptions::Flags(0)),
_peer->isSelf() ? MTP_inputPeerSelf() : _peer->input,
MTP_string(token)
)).done([=](const MTPpayments_StarsStatus &result) {

View File

@@ -82,7 +82,8 @@ public:
Fn<void(Data::CreditsStatusSlice)> done);
void requestSubscriptions(
const Data::CreditsStatusSlice::OffsetToken &token,
Fn<void(Data::CreditsStatusSlice)> done);
Fn<void(Data::CreditsStatusSlice)> done,
bool missingBalance = false);
private:
using HistoryTL = MTPpayments_GetStarsTransactions;