Added initial api support of refund flag to credits history entries.

This commit is contained in:
23rd 2024-05-28 02:28:13 +03:00 committed by John Preston
parent be099880d8
commit ebaffc333e
3 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,7 @@ namespace {
}, [](const MTPDstarsTransactionPeerPremiumBot &) {
return Data::CreditsHistoryEntry::PeerType::PremiumBot;
}),
.refunded = tl.data().is_refund(),
};
}

View File

@ -37,6 +37,7 @@ struct CreditsHistoryEntry final {
uint64 credits = 0;
uint64 bareId = 0;
PeerType peerType;
bool refunded = false;
};
struct CreditsStatusSlice final {

View File

@ -473,6 +473,16 @@ void ReceiptCreditsBox(
st::defaultFlatLabel)));
}
if (e.refunded) {
Ui::AddSkip(content);
box->addRow(object_ptr<Ui::CenterWrap<>>(
box,
object_ptr<Ui::FlatLabel>(
box,
tr::lng_channel_earn_history_return_about(),
st::defaultFlatLabel)));
}
Ui::AddSkip(content);
Ui::AddSkip(content);