2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Support phrases for unclaimed giveaway prizes.

This commit is contained in:
John Preston
2023-10-28 21:26:56 +04:00
parent c480ab1a3b
commit fe0e526b79
9 changed files with 48 additions and 13 deletions

View File

@@ -477,11 +477,18 @@ void GiftCodeBox(
tr::lng_gift_link_label_from(),
controller,
current.from);
AddTableRow(
table,
tr::lng_gift_link_label_to(),
controller,
current.to);
if (current.to) {
AddTableRow(
table,
tr::lng_gift_link_label_to(),
controller,
current.to);
} else {
AddTableRow(
table,
tr::lng_gift_link_label_to(),
tr::lng_gift_link_label_to_unclaimed(Ui::Text::WithEntities));
}
AddTableRow(
table,
tr::lng_gift_link_label_gift(),
@@ -493,11 +500,16 @@ void GiftCodeBox(
table,
tr::lng_gift_link_label_reason(),
(current.giveawayId
? (tr::lng_gift_link_reason_giveaway() | Ui::Text::ToLink())
? ((current.to
? tr::lng_gift_link_reason_giveaway
: tr::lng_gift_link_reason_unclaimed)(
) | Ui::Text::ToLink())
: current.giveaway
? (tr::lng_gift_link_reason_giveaway(
Ui::Text::WithEntities
) | rpl::type_erased())
? ((current.to
? tr::lng_gift_link_reason_giveaway
: tr::lng_gift_link_reason_unclaimed)(
Ui::Text::WithEntities
) | rpl::type_erased())
: tr::lng_gift_link_reason_chosen(Ui::Text::WithEntities)));
reason->setClickHandlerFilter([=](const auto &...) {
controller->showPeerHistory(