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

Correctly show commission in stars stats.

This commit is contained in:
John Preston
2024-11-29 22:13:16 +04:00
parent 552dd318cd
commit b401c37c39
11 changed files with 75 additions and 11 deletions

View File

@@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_photo_media.h"
#include "data/data_session.h"
#include "history/view/media/history_view_sticker_player.h"
#include "info/bot/starref/info_bot_starref_common.h"
#include "info/userpic/info_userpic_emoji_builder_preview.h"
#include "lang/lang_keys.h"
#include "main/main_session.h"
@@ -545,7 +546,15 @@ Fn<PaintRoundImageCallback(Fn<void()>)> PaintPreviewCallback(
}
TextWithEntities GenerateEntryName(const Data::CreditsHistoryEntry &entry) {
return (entry.floodSkip
return (entry.starrefCommission && !entry.starrefAmount)
? tr::lng_credits_commission(
tr::now,
lt_amount,
TextWithEntities{
Info::BotStarRef::FormatCommission(entry.starrefCommission)
},
TextWithEntities::Simple)
: (entry.floodSkip
? tr::lng_credits_box_history_entry_api
: entry.reaction
? tr::lng_credits_box_history_entry_reaction_name