mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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#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#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_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_giveaway_results_none" = "No winners of the giveaway could be selected.";
|
||||||
"lng_action_boost_apply#one" = "{from} boosted the group";
|
"lng_action_boost_apply#one" = "{from} boosted the group";
|
||||||
"lng_action_boost_apply#other" = "{from} boosted the group {count} times";
|
"lng_action_boost_apply#other" = "{from} boosted the group {count} times";
|
||||||
|
|
|
@ -1543,6 +1543,7 @@ ServiceAction ParseServiceAction(
|
||||||
auto content = ActionGiveawayResults();
|
auto content = ActionGiveawayResults();
|
||||||
content.winners = data.vwinners_count().v;
|
content.winners = data.vwinners_count().v;
|
||||||
content.unclaimed = data.vunclaimed_count().v;
|
content.unclaimed = data.vunclaimed_count().v;
|
||||||
|
content.credits = data.is_stars();
|
||||||
result.content = content;
|
result.content = content;
|
||||||
}, [&](const MTPDmessageActionBoostApply &data) {
|
}, [&](const MTPDmessageActionBoostApply &data) {
|
||||||
auto content = ActionBoostApply();
|
auto content = ActionBoostApply();
|
||||||
|
|
|
@ -590,6 +590,7 @@ struct ActionGiveawayLaunch {
|
||||||
struct ActionGiveawayResults {
|
struct ActionGiveawayResults {
|
||||||
int winners = 0;
|
int winners = 0;
|
||||||
int unclaimed = 0;
|
int unclaimed = 0;
|
||||||
|
bool credits = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ActionBoostApply {
|
struct ActionBoostApply {
|
||||||
|
|
|
@ -1313,11 +1313,20 @@ auto HtmlWriter::Wrap::pushMessage(
|
||||||
return serviceFrom + " just started a giveaway "
|
return serviceFrom + " just started a giveaway "
|
||||||
"of Telegram Premium subscriptions to its followers.";
|
"of Telegram Premium subscriptions to its followers.";
|
||||||
}, [&](const ActionGiveawayResults &data) {
|
}, [&](const ActionGiveawayResults &data) {
|
||||||
return (data.winners > 0)
|
return !data.winners
|
||||||
? NumberToString(data.winners)
|
? "No winners of the giveaway could be selected."
|
||||||
+ " of the giveaway were randomly selected by Telegram "
|
: (data.credits && data.unclaimed)
|
||||||
"and received private messages with giftcodes."
|
? "Some winners of the giveaway were randomly selected by "
|
||||||
: "No winners of the giveaway could be selected.";
|
"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) {
|
}, [&](const ActionBoostApply &data) {
|
||||||
return serviceFrom
|
return serviceFrom
|
||||||
+ " boosted the group "
|
+ " boosted the group "
|
||||||
|
|
|
@ -615,6 +615,7 @@ QByteArray SerializeMessage(
|
||||||
pushAction("giveaway_results");
|
pushAction("giveaway_results");
|
||||||
push("winners", data.winners);
|
push("winners", data.winners);
|
||||||
push("unclaimed", data.unclaimed);
|
push("unclaimed", data.unclaimed);
|
||||||
|
push("stars", data.credits);
|
||||||
}, [&](const ActionSetChatWallPaper &data) {
|
}, [&](const ActionSetChatWallPaper &data) {
|
||||||
pushActor();
|
pushActor();
|
||||||
pushAction(data.same
|
pushAction(data.same
|
||||||
|
|
|
@ -5180,15 +5180,20 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
|
||||||
auto result = PreparedServiceText();
|
auto result = PreparedServiceText();
|
||||||
const auto winners = action.vwinners_count().v;
|
const auto winners = action.vwinners_count().v;
|
||||||
const auto unclaimed = action.vunclaimed_count().v;
|
const auto unclaimed = action.vunclaimed_count().v;
|
||||||
|
const auto credits = action.is_stars();
|
||||||
result.text = {
|
result.text = {
|
||||||
(!winners
|
(!winners
|
||||||
? tr::lng_action_giveaway_results_none(tr::now)
|
? 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_some(tr::now)
|
||||||
: tr::lng_action_giveaway_results(
|
: (credits && !unclaimed)
|
||||||
|
? tr::lng_action_giveaway_results_credits(
|
||||||
tr::now,
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
winners))
|
winners)
|
||||||
|
: tr::lng_action_giveaway_results(tr::now, lt_count, winners))
|
||||||
};
|
};
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue