mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Improved phrases in service message for giveaway results with credits.
This commit is contained in:
parent
d78348fd16
commit
13353bb615
6 changed files with 28 additions and 8 deletions
|
@ -1898,6 +1898,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_action_giveaway_results#one" = "{count} winner of the giveaway was randomly selected by Telegram and received private messages with giftcodes.";
|
||||
"lng_action_giveaway_results#other" = "{count} winners of the giveaway were randomly selected by Telegram and received private messages with giftcodes.";
|
||||
"lng_action_giveaway_results_some" = "Some winners of the giveaway were randomly selected by Telegram and received private messages with giftcodes.";
|
||||
"lng_action_giveaway_results_credits#one" = "{count} winner of the giveaway was randomly selected by Telegram and received their prize.";
|
||||
"lng_action_giveaway_results_credits#other" = "{count} winner of the giveaway was randomly selected by Telegram and received their prize.";
|
||||
"lng_action_giveaway_results_credits_some" = "Some winners of the giveaway were randomly selected by Telegram and received their prize.";
|
||||
"lng_action_giveaway_results_none" = "No winners of the giveaway could be selected.";
|
||||
"lng_action_boost_apply#one" = "{from} boosted the group";
|
||||
"lng_action_boost_apply#other" = "{from} boosted the group {count} times";
|
||||
|
|
|
@ -1543,6 +1543,7 @@ ServiceAction ParseServiceAction(
|
|||
auto content = ActionGiveawayResults();
|
||||
content.winners = data.vwinners_count().v;
|
||||
content.unclaimed = data.vunclaimed_count().v;
|
||||
content.credits = data.is_stars();
|
||||
result.content = content;
|
||||
}, [&](const MTPDmessageActionBoostApply &data) {
|
||||
auto content = ActionBoostApply();
|
||||
|
|
|
@ -590,6 +590,7 @@ struct ActionGiveawayLaunch {
|
|||
struct ActionGiveawayResults {
|
||||
int winners = 0;
|
||||
int unclaimed = 0;
|
||||
bool credits = false;
|
||||
};
|
||||
|
||||
struct ActionBoostApply {
|
||||
|
|
|
@ -1313,11 +1313,20 @@ auto HtmlWriter::Wrap::pushMessage(
|
|||
return serviceFrom + " just started a giveaway "
|
||||
"of Telegram Premium subscriptions to its followers.";
|
||||
}, [&](const ActionGiveawayResults &data) {
|
||||
return (data.winners > 0)
|
||||
? NumberToString(data.winners)
|
||||
+ " of the giveaway were randomly selected by Telegram "
|
||||
"and received private messages with giftcodes."
|
||||
: "No winners of the giveaway could be selected.";
|
||||
return !data.winners
|
||||
? "No winners of the giveaway could be selected."
|
||||
: (data.credits && data.unclaimed)
|
||||
? "Some winners of the giveaway were randomly selected by "
|
||||
"Telegram and received their prize."
|
||||
: (!data.credits && data.unclaimed)
|
||||
? "Some winners of the giveaway were randomly selected by "
|
||||
"Telegram and received private messages with giftcodes."
|
||||
: (data.credits && !data.unclaimed)
|
||||
? NumberToString(data.winners) + " of the giveaway was randomly "
|
||||
"selected by Telegram and received their prize."
|
||||
: NumberToString(data.winners) + " of the giveaway was randomly "
|
||||
"selected by Telegram and received private messages with "
|
||||
"giftcodes.";
|
||||
}, [&](const ActionBoostApply &data) {
|
||||
return serviceFrom
|
||||
+ " boosted the group "
|
||||
|
|
|
@ -615,6 +615,7 @@ QByteArray SerializeMessage(
|
|||
pushAction("giveaway_results");
|
||||
push("winners", data.winners);
|
||||
push("unclaimed", data.unclaimed);
|
||||
push("stars", data.credits);
|
||||
}, [&](const ActionSetChatWallPaper &data) {
|
||||
pushActor();
|
||||
pushAction(data.same
|
||||
|
|
|
@ -5180,15 +5180,20 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
|
|||
auto result = PreparedServiceText();
|
||||
const auto winners = action.vwinners_count().v;
|
||||
const auto unclaimed = action.vunclaimed_count().v;
|
||||
const auto credits = action.is_stars();
|
||||
result.text = {
|
||||
(!winners
|
||||
? tr::lng_action_giveaway_results_none(tr::now)
|
||||
: unclaimed
|
||||
: (credits && unclaimed)
|
||||
? tr::lng_action_giveaway_results_credits_some(tr::now)
|
||||
: (!credits && unclaimed)
|
||||
? tr::lng_action_giveaway_results_some(tr::now)
|
||||
: tr::lng_action_giveaway_results(
|
||||
: (credits && !unclaimed)
|
||||
? tr::lng_action_giveaway_results_credits(
|
||||
tr::now,
|
||||
lt_count,
|
||||
winners))
|
||||
winners)
|
||||
: tr::lng_action_giveaway_results(tr::now, lt_count, winners))
|
||||
};
|
||||
return result;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue