Added phrase for paid reactions of live stories to credits earn history.

This commit is contained in:
23rd
2025-11-25 17:58:11 +03:00
parent b400964aa1
commit 68665ec1f2
5 changed files with 14 additions and 1 deletions
+1
View File
@@ -2958,6 +2958,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_credits_summary_history_entry_inner_in" = "In-App Purchase"; "lng_credits_summary_history_entry_inner_in" = "In-App Purchase";
"lng_credits_summary_balance" = "Balance"; "lng_credits_summary_balance" = "Balance";
"lng_credits_commission" = "{amount} commission"; "lng_credits_commission" = "{amount} commission";
"lng_credits_paid_messages_fee_live_reaction" = "Fee for Live Story Reaction";
"lng_credits_paid_messages_fee#one" = "Fee for {count} Message"; "lng_credits_paid_messages_fee#one" = "Fee for {count} Message";
"lng_credits_paid_messages_fee#other" = "Fee for {count} Messages"; "lng_credits_paid_messages_fee#other" = "Fee for {count} Messages";
"lng_credits_paid_messages_fee_about" = "You receive {percent} of the price that you charge for each incoming message. {link}"; "lng_credits_paid_messages_fee_about" = "You receive {percent} of the price that you charge for each incoming message. {link}";
+4
View File
@@ -40,6 +40,10 @@ struct CreditsHistoryEntry final {
return !id.isEmpty(); return !id.isEmpty();
} }
[[nodiscard]] bool isLiveStoryReaction() const {
return paidMessagesCount && reaction && !bareMsgId;
}
using PhotoId = uint64; using PhotoId = uint64;
enum class PeerType { enum class PeerType {
Peer, Peer,
@@ -882,7 +882,9 @@ void CreditsRow::init() {
const auto name = !isSpecial const auto name = !isSpecial
? PeerListRow::generateName() ? PeerListRow::generateName()
: Ui::GenerateEntryName(_entry).text; : Ui::GenerateEntryName(_entry).text;
_name = _entry.paidMessagesCount _name = _entry.isLiveStoryReaction()
? tr::lng_credits_paid_messages_fee_live_reaction(tr::now)
: _entry.paidMessagesCount
? tr::lng_credits_paid_messages_fee( ? tr::lng_credits_paid_messages_fee(
tr::now, tr::now,
lt_count, lt_count,
@@ -1475,6 +1475,8 @@ void GenericCreditsEntryBox(
? tr::lng_credits_box_history_entry_giveaway_name(tr::now) ? tr::lng_credits_box_history_entry_giveaway_name(tr::now)
: (!e.subscriptionUntil.isNull() && e.title.isEmpty()) : (!e.subscriptionUntil.isNull() && e.title.isEmpty())
? tr::lng_credits_box_history_entry_subscription(tr::now) ? tr::lng_credits_box_history_entry_subscription(tr::now)
: e.isLiveStoryReaction()
? tr::lng_credits_paid_messages_fee_live_reaction(tr::now)
: e.paidMessagesCount : e.paidMessagesCount
? tr::lng_credits_paid_messages_fee( ? tr::lng_credits_paid_messages_fee(
tr::now, tr::now,
@@ -569,6 +569,10 @@ TextWithEntities GenerateEntryName(const Data::CreditsHistoryEntry &entry) {
Info::BotStarRef::FormatCommission(entry.starrefCommission) Info::BotStarRef::FormatCommission(entry.starrefCommission)
}, },
TextWithEntities::Simple) TextWithEntities::Simple)
: entry.isLiveStoryReaction()
? tr::lng_credits_paid_messages_fee_live_reaction(
tr::now,
TextWithEntities::Simple)
: entry.paidMessagesCount : entry.paidMessagesCount
? tr::lng_credits_paid_messages_fee( ? tr::lng_credits_paid_messages_fee(
tr::now, tr::now,