Improve archive / unarchive story toast.

This commit is contained in:
John Preston 2023-06-23 20:39:57 +04:00
parent 3c44cf0251
commit 0183790518
2 changed files with 11 additions and 5 deletions

View File

@ -3826,8 +3826,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_stories_archive_title" = "Stories Archive";
"lng_stories_archive_about" = "Only you can see archived stories unless you choose to save them to your profile.";
"lng_stories_reply_sent" = "Message Sent";
"lng_stories_hidden_to_contacts" = "Those stories are now shown only in your Contacts list.";
"lng_stories_shown_in_chats" = "Those stories are now shown in your Chats list.";
"lng_stories_hidden_to_contacts" = "Stories from {user} will now be shown in Contacts, not Chats.";
"lng_stories_shown_in_chats" = "Stories from {user} will now be shown in Chats, not Contacts.";
"lng_stories_delete_one_sure" = "Are you sure you want to delete this story?";
"lng_stories_delete_sure#one" = "Are you sure you want to delete {count} story?";
"lng_stories_delete_sure#other" = "Are you sure you want to delete {count} stories?";

View File

@ -1197,11 +1197,17 @@ void Stories::toggleHidden(
)).send();
}
const auto name = user->shortName();
const auto guard = gsl::finally([&] {
if (show) {
show->showToast(hidden
? tr::lng_stories_hidden_to_contacts(tr::now)
: tr::lng_stories_shown_in_chats(tr::now));
const auto phrase = hidden
? tr::lng_stories_hidden_to_contacts
: tr::lng_stories_shown_in_chats;
show->showToast(phrase(
tr::now,
lt_user,
Ui::Text::Bold(name),
Ui::Text::WithEntities));
}
});