2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

Hide native notification details on lock screen.

This commit is contained in:
John Preston
2021-04-27 13:51:52 +04:00
parent e9196bbbb5
commit e26e666135
7 changed files with 16 additions and 19 deletions

View File

@@ -576,9 +576,10 @@ void System::updateAll() {
}
}
Manager::DisplayOptions Manager::GetNotificationOptions(HistoryItem *item) {
Manager::DisplayOptions Manager::getNotificationOptions(
HistoryItem *item) const {
const auto hideEverything = Core::App().passcodeLocked()
|| Platform::Notifications::HideDetails();
|| forceHideDetails();
const auto view = Core::App().settings().notifyView();
DisplayOptions result;
@@ -696,7 +697,7 @@ void Manager::notificationReplied(
void NativeManager::doShowNotification(
not_null<HistoryItem*> item,
int forwardedCount) {
const auto options = GetNotificationOptions(item);
const auto options = getNotificationOptions(item);
const auto peer = item->history()->peer;
const auto scheduled = !options.hideNameAndPhoto
@@ -732,6 +733,10 @@ void NativeManager::doShowNotification(
options.hideReplyButton);
}
bool NativeManager::forceHideDetails() const {
return Global::ScreenIsLocked();
}
System::~System() = default;
QString WrapFromScheduled(const QString &text) {