mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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
|
@ -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" = "You can dispute this transaction {link}.";
|
||||||
"lng_credits_box_history_entry_about_link" = "here";
|
"lng_credits_box_history_entry_about_link" = "here";
|
||||||
"lng_credits_box_history_entry_reaction_name" = "Star Reaction";
|
"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#one" = "{count} Star Needed";
|
||||||
"lng_credits_small_balance_title#other" = "{count} Stars 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.";
|
"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 &) {
|
}, [](const MTPDstarsTransactionPeerAds &) {
|
||||||
return Data::CreditsHistoryEntry::PeerType::Ads;
|
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()
|
.successDate = tl.data().vtransaction_date()
|
||||||
? base::unixtime::parse(tl.data().vtransaction_date()->v)
|
? base::unixtime::parse(tl.data().vtransaction_date()->v)
|
||||||
: QDateTime(),
|
: QDateTime(),
|
||||||
|
|
|
@ -52,6 +52,7 @@ struct CreditsHistoryEntry final {
|
||||||
uint64 bareMsgId = 0;
|
uint64 bareMsgId = 0;
|
||||||
uint64 barePeerId = 0;
|
uint64 barePeerId = 0;
|
||||||
PeerType peerType;
|
PeerType peerType;
|
||||||
|
QDateTime subscriptionUntil;
|
||||||
QDateTime successDate;
|
QDateTime successDate;
|
||||||
QString successLink;
|
QString successLink;
|
||||||
bool reaction = false;
|
bool reaction = false;
|
||||||
|
|
|
@ -805,6 +805,9 @@ void CreditsRow::init() {
|
||||||
? (joiner + tr::lng_channel_earn_history_pending(tr::now))
|
? (joiner + tr::lng_channel_earn_history_pending(tr::now))
|
||||||
: _entry.failed
|
: _entry.failed
|
||||||
? (joiner + tr::lng_channel_earn_history_failed(tr::now))
|
? (joiner + tr::lng_channel_earn_history_failed(tr::now))
|
||||||
|
: !_entry.subscriptionUntil.isNull()
|
||||||
|
? (joiner
|
||||||
|
+ tr::lng_credits_box_history_entry_subscription(tr::now))
|
||||||
: QString())
|
: QString())
|
||||||
+ ((_entry.gift && PeerListRow::special())
|
+ ((_entry.gift && PeerListRow::special())
|
||||||
? (joiner + tr::lng_credits_box_history_entry_anonymous(tr::now))
|
? (joiner + tr::lng_credits_box_history_entry_anonymous(tr::now))
|
||||||
|
|
|
@ -549,8 +549,9 @@ void ReceiptCreditsBox(
|
||||||
box,
|
box,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
box,
|
box,
|
||||||
rpl::single(
|
rpl::single(!e.subscriptionUntil.isNull()
|
||||||
!e.title.isEmpty()
|
? tr::lng_credits_box_history_entry_subscription(tr::now)
|
||||||
|
: !e.title.isEmpty()
|
||||||
? e.title
|
? e.title
|
||||||
: e.gift
|
: e.gift
|
||||||
? tr::lng_credits_box_history_entry_gift_name(tr::now)
|
? tr::lng_credits_box_history_entry_gift_name(tr::now)
|
||||||
|
|
Loading…
Add table
Reference in a new issue