Skip to content

Commit

Permalink
Merge branch 'low_urgency_notifications' into 'master'
Browse files Browse the repository at this point in the history
Low urgency notifications

See merge request mer-core/commhistory-daemon!50
  • Loading branch information
pvuorela committed Oct 30, 2020
2 parents 651ff1d + 21e0d21 commit edd803b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
5 changes: 2 additions & 3 deletions src/notificationmanager.cpp
Expand Up @@ -303,10 +303,9 @@ void NotificationManager::showNotification(const CommHistory::Event& event,
amendCallNotification(personal, event, text);

if (event.type() == CommHistory::Event::CallEvent) {
// avoid popup
Notification *notification = personal->notification();

notification->clearPreviewSummary();
notification->clearPreviewBody();
notification->setUrgency(Notification::Low);
}

personal->publishNotification();
Expand Down
4 changes: 2 additions & 2 deletions src/personalnotification.cpp
Expand Up @@ -170,8 +170,8 @@ void PersonalNotification::publishNotification()
NotificationManager::instance()->setNotificationProperties(m_notification, this, false);

if (collection() == Voice) {
m_notification->clearPreviewSummary();
m_notification->clearPreviewBody();
// avoid popup
m_notification->setUrgency(Notification::Low);
}

m_notification->publish();
Expand Down
18 changes: 6 additions & 12 deletions src/personalnotification.h
Expand Up @@ -57,18 +57,12 @@ class PersonalNotification : public QObject, public Serialisable
Q_PROPERTY(uint chatType READ chatType WRITE setChatType)

Q_PROPERTY(uint contactid READ contactId)
Q_PROPERTY(QString notificationtext READ notificationText
WRITE setNotificationText)
Q_PROPERTY(bool haspendingevents READ hasPendingEvents
WRITE setHasPendingEvents)
Q_PROPERTY(QString chatName READ chatName
WRITE setChatName)
Q_PROPERTY(QString eventToken READ eventToken
WRITE setEventToken)
Q_PROPERTY(QString smsReplaceNumber READ smsReplaceNumber
WRITE setSmsReplaceNumber)
Q_PROPERTY(bool hidden READ hidden
WRITE setHidden)
Q_PROPERTY(QString notificationtext READ notificationText WRITE setNotificationText)
Q_PROPERTY(bool haspendingevents READ hasPendingEvents WRITE setHasPendingEvents)
Q_PROPERTY(QString chatName READ chatName WRITE setChatName)
Q_PROPERTY(QString eventToken READ eventToken WRITE setEventToken)
Q_PROPERTY(QString smsReplaceNumber READ smsReplaceNumber WRITE setSmsReplaceNumber)
Q_PROPERTY(bool hidden READ hidden WRITE setHidden)

public:
enum EventCollection { Messaging = 0, Voicemail, Voice };
Expand Down

0 comments on commit edd803b

Please sign in to comment.