mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Added subscription date to credits history entries.
This commit is contained in:
parent
d1313f38eb
commit
cc3baad377
5 changed files with 12 additions and 2 deletions
Telegram
Resources/langs
SourceFiles
api
data
info/statistics
settings
|
@ -2414,6 +2414,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_credits_box_history_entry_about" = "You can dispute this transaction {link}.";
|
||||
"lng_credits_box_history_entry_about_link" = "here";
|
||||
"lng_credits_box_history_entry_reaction_name" = "Star Reaction";
|
||||
"lng_credits_box_history_entry_subscription" = "Monthly subscription fee";
|
||||
"lng_credits_small_balance_title#one" = "{count} Star Needed";
|
||||
"lng_credits_small_balance_title#other" = "{count} Stars Needed";
|
||||
"lng_credits_small_balance_about" = "Buy **Stars** and use them on **{bot}** and other miniapps.";
|
||||
|
|
|
@ -94,6 +94,10 @@ constexpr auto kTransactionsLimit = 100;
|
|||
}, [](const MTPDstarsTransactionPeerAds &) {
|
||||
return Data::CreditsHistoryEntry::PeerType::Ads;
|
||||
}),
|
||||
.subscriptionUntil = tl.data().vsubscription_period()
|
||||
? base::unixtime::parse(base::unixtime::now()
|
||||
+ tl.data().vsubscription_period()->v)
|
||||
: QDateTime(),
|
||||
.successDate = tl.data().vtransaction_date()
|
||||
? base::unixtime::parse(tl.data().vtransaction_date()->v)
|
||||
: QDateTime(),
|
||||
|
|
|
@ -52,6 +52,7 @@ struct CreditsHistoryEntry final {
|
|||
uint64 bareMsgId = 0;
|
||||
uint64 barePeerId = 0;
|
||||
PeerType peerType;
|
||||
QDateTime subscriptionUntil;
|
||||
QDateTime successDate;
|
||||
QString successLink;
|
||||
bool reaction = false;
|
||||
|
|
|
@ -805,6 +805,9 @@ void CreditsRow::init() {
|
|||
? (joiner + tr::lng_channel_earn_history_pending(tr::now))
|
||||
: _entry.failed
|
||||
? (joiner + tr::lng_channel_earn_history_failed(tr::now))
|
||||
: !_entry.subscriptionUntil.isNull()
|
||||
? (joiner
|
||||
+ tr::lng_credits_box_history_entry_subscription(tr::now))
|
||||
: QString())
|
||||
+ ((_entry.gift && PeerListRow::special())
|
||||
? (joiner + tr::lng_credits_box_history_entry_anonymous(tr::now))
|
||||
|
|
|
@ -549,8 +549,9 @@ void ReceiptCreditsBox(
|
|||
box,
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
box,
|
||||
rpl::single(
|
||||
!e.title.isEmpty()
|
||||
rpl::single(!e.subscriptionUntil.isNull()
|
||||
? tr::lng_credits_box_history_entry_subscription(tr::now)
|
||||
: !e.title.isEmpty()
|
||||
? e.title
|
||||
: e.gift
|
||||
? tr::lng_credits_box_history_entry_gift_name(tr::now)
|
||||
|
|
Loading…
Add table
Reference in a new issue