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

Hide login code with a spoiler in chats list.

This commit is contained in:
John Preston
2023-04-25 11:45:31 +04:00
parent 11906297d8
commit 864959aee0
11 changed files with 61 additions and 4 deletions

View File

@@ -856,6 +856,10 @@ Manager::DisplayOptions Manager::getNotificationOptions(
&& (!topic || !Data::CanSendTexts(topic)))
|| peer->isBroadcast()
|| (peer->slowmodeSecondsLeft() > 0);
result.spoilerLoginCode = item
&& !item->out()
&& peer->isNotificationsUser()
&& Core::App().isSharingScreen();
return result;
}
@@ -1167,7 +1171,9 @@ void NativeManager::doShowNotification(NotificationFields &&fields) {
? tr::lng_forward_messages(tr::now, lt_count, fields.forwardedCount)
: item->groupId()
? tr::lng_in_dlg_album(tr::now)
: TextWithPermanentSpoiler(item->notificationText());
: TextWithPermanentSpoiler(item->notificationText({
.spoilerLoginCode = options.spoilerLoginCode,
}));
// #TODO optimize
auto userpicView = item->history()->peer->createUserpicView();