Skip to content

Commit

Permalink
Merge branch 'jb51470' into 'master'
Browse files Browse the repository at this point in the history
Use default event with notifications that don't have feedback hint.

See merge request mer-core/lipstick!160
  • Loading branch information
jusa committed Oct 9, 2020
2 parents bfd36aa + e9985ed commit 83c4721
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/notifications/notificationfeedbackplayer.cpp
Expand Up @@ -64,9 +64,18 @@ void NotificationFeedbackPlayer::addNotification(uint id)

// Play the feedback related to the notification if any
const QString feedback = notification->hints().value(LipstickNotification::HINT_FEEDBACK).toString();
const QStringList feedbackItems = feedback.split(QStringLiteral(","), QString::SkipEmptyParts);
QStringList feedbackItems = feedback.split(QStringLiteral(","), QString::SkipEmptyParts);

if (isEnabled(notification, m_minimumPriority) && !feedbackItems.isEmpty()) {
int minimumPriority = m_minimumPriority;

if (feedbackItems.isEmpty() && isEnabled(notification, 0)) {
// Add generic feedback type
feedbackItems << "default";
// Play default feedback regardless of priorities
minimumPriority = 0;
}

if (isEnabled(notification, minimumPriority) && !feedbackItems.isEmpty()) {
QMap<QString, QVariant> properties;
if (notification->body().isEmpty() && notification->summary().isEmpty()) {
properties.insert("media.leds", false);
Expand Down

0 comments on commit 83c4721

Please sign in to comment.