Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[lipstick] Don't show notification popups for low priority. Contribut…
…es to JB#51197

Why bother user if it's low priority already. Transient ones still
just in case.
  • Loading branch information
pvuorela committed Sep 16, 2020
1 parent faefbc7 commit fc1838e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/notifications/notificationpreviewpresenter.cpp
Expand Up @@ -187,6 +187,7 @@ void NotificationPreviewPresenter::createWindowIfNecessary()
bool NotificationPreviewPresenter::notificationShouldBeShown(LipstickNotification *notification)
{
if (notification->restored()
|| (notification->urgency() == LipstickNotification::Low && !notification->isTransient())
|| (notification->previewBody().isEmpty() && notification->previewSummary().isEmpty())) {
return false;
}
Expand All @@ -197,7 +198,7 @@ bool NotificationPreviewPresenter::notificationShouldBeShown(LipstickNotificatio

const bool screenLocked = m_screenLock->isScreenLocked();
const bool deviceLocked = m_deviceLock->state() >= NemoDeviceLock::DeviceLock::Locked;
const bool notificationIsCritical = notification->urgency() >= 2
const bool notificationIsCritical = notification->urgency() >= LipstickNotification::Critical
|| notification->hints().value(LipstickNotification::HINT_DISPLAY_ON).toBool();
const bool notificationIsPublic = notification->hints().value(LipstickNotification::HINT_VISIBILITY).toString()
.compare(QLatin1String("public"), Qt::CaseInsensitive) == 0;
Expand Down Expand Up @@ -243,7 +244,7 @@ void NotificationPreviewPresenter::setCurrentNotification(LipstickNotification *

if (notification) {
// Ask mce to turn the screen on if requested
const bool notificationIsCritical = notification->urgency() >= 2;
const bool notificationIsCritical = notification->urgency() >= LipstickNotification::Critical;
const bool displayOnRequested = notification->hints().value(LipstickNotification::HINT_DISPLAY_ON).toBool()
&& !m_notificationFeedbackPlayer->doNotDisturbMode();
const bool notificationCanUnblank
Expand Down

0 comments on commit fc1838e

Please sign in to comment.