Skip to content

Commit

Permalink
[commhistory-daemon] Don't set x-nemo-max-content-lines notification …
Browse files Browse the repository at this point in the history
…hint. JB#50243

x-nemo-max-content-lines is currently set '1' to ensure the body text
is not shown for the notification. This hint has been deprecated, so
instead of setting that, just avoid setting a body and previewBody
instead.

SMS and MMS notifications should still show the body content, as those
previously had x-nemo-max-content-lines=6 to ensure the body was shown.
  • Loading branch information
Bea Lam committed Jul 27, 2020
1 parent 3221706 commit 4d64c43
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 12 deletions.
1 change: 0 additions & 1 deletion data/notifications/x-nemo.call.missed.conf
@@ -1,6 +1,5 @@
app_icon=icon-lock-missed-call
urgency=2
x-nemo-priority=120
x-nemo-max-content-lines=1
x-nemo-feedback=call_exists
x-nemo-led-disabled-without-body-and-summary=false
1 change: 0 additions & 1 deletion data/notifications/x-nemo.call.missed.group.conf
@@ -1,6 +1,5 @@
app_icon=icon-lock-missed-call
urgency=2
x-nemo-priority=120
x-nemo-max-content-lines=1
x-nemo-feedback=call_exists
x-nemo-led-disabled-without-body-and-summary=false
1 change: 0 additions & 1 deletion data/notifications/x-nemo.messaging.im.conf
@@ -1,6 +1,5 @@
app_icon=icon-lock-sms
urgency=2
x-nemo-priority=120
x-nemo-max-content-lines=6
x-nemo-feedback=chat_exists
x-nemo-led-disabled-without-body-and-summary=false
1 change: 0 additions & 1 deletion data/notifications/x-nemo.messaging.mms.conf
@@ -1,6 +1,5 @@
app_icon=icon-lock-sms
urgency=2
x-nemo-priority=120
x-nemo-max-content-lines=6
x-nemo-feedback=sms_exists
x-nemo-led-disabled-without-body-and-summary=false
1 change: 0 additions & 1 deletion data/notifications/x-nemo.messaging.sms.conf
@@ -1,6 +1,5 @@
app_icon=icon-lock-sms
urgency=2
x-nemo-priority=120
x-nemo-max-content-lines=6
x-nemo-feedback=sms_exists
x-nemo-led-disabled-without-body-and-summary=false
1 change: 0 additions & 1 deletion data/notifications/x-nemo.messaging.voicemail-waiting.conf
@@ -1,6 +1,5 @@
app_icon=icon-lock-voicemail
x-nemo-priority=120
x-nemo-max-content-lines=1
x-nemo-user-removable=false
x-nemo-feedback=sms,sms_exists
x-nemo-led-disabled-without-body-and-summary=false
Expand Down
1 change: 0 additions & 1 deletion data/notifications/x-nemo.messaging.voicemail.conf
Expand Up @@ -2,6 +2,5 @@ app_icon=icon-lock-voicemail
urgency=2
x-nemo-user-removable=false
x-nemo-priority=120
x-nemo-max-content-lines=1
x-nemo-feedback=sms_exists
x-nemo-led-disabled-without-body-and-summary=false
1 change: 0 additions & 1 deletion data/notifications/x-nemo.messaging.voicemail.group.conf
Expand Up @@ -2,6 +2,5 @@ app_icon=icon-lock-voicemail
urgency=2
x-nemo-priority=120
x-nemo-user-removable=false
x-nemo-max-content-lines=1
x-nemo-feedback=sms_exists
x-nemo-led-disabled-without-body-and-summary=false
15 changes: 12 additions & 3 deletions src/notificationgroup.cpp
Expand Up @@ -2,7 +2,8 @@
**
** This file is part of commhistory-daemon.
**
** Copyright (C) 2013 Jolla Ltd.
** Copyright (C) 2020 Open Mobile Platform LLC.
** Copyright (C) 2013 - 2019 Jolla Ltd.
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** Contact: John Brooks <john.brooks@jolla.com>
**
Expand Down Expand Up @@ -145,10 +146,18 @@ void NotificationGroup::updateGroup()
connect(mGroup, SIGNAL(closed(uint)), SLOT(onClosed(uint)));
}

const QString body(notificationGroupText());

mGroup->setAppName(groupName(m_collection));
mGroup->setCategory(groupCategory(m_collection));
mGroup->setSummary(mLocale.joinStringList(contactNames()));
mGroup->setBody(notificationGroupText());
if (m_collection != PersonalNotification::Voice
&& m_collection != PersonalNotification::Voicemail) {
// For missed calls and voicemail, the Events view notification is compressed into one
// line with only the summary, as the body information is duplicated in the notification
// group header ('missed calls' or 'new voicemails').
mGroup->setBody(body);
}
mGroup->setItemCount(mNotifications.size());

// This group is only visible if the members are hidden
Expand Down Expand Up @@ -186,7 +195,7 @@ void NotificationGroup::updateGroup()
preview.setAppName(mGroup->appName());
preview.setCategory(mGroup->category() + QStringLiteral(".preview"));
preview.setPreviewSummary(mGroup->summary());
preview.setPreviewBody(mGroup->body());
preview.setPreviewBody(body);

NotificationManager::instance()->setNotificationProperties(&preview, mNotifications[0], grouped);

Expand Down
2 changes: 1 addition & 1 deletion src/notificationmanager.cpp
Expand Up @@ -2,6 +2,7 @@
**
** This file is part of commhistory-daemon.
**
** Copyright (C) 2020 Open Mobile Platform LLC.
** Copyright (C) 2013-2016 Jolla Ltd.
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** Contact: John Brooks <john.brooks@jolla.com>
Expand Down Expand Up @@ -809,7 +810,6 @@ void NotificationManager::slotVoicemailWaitingChanged()
voicemailNotification.setPreviewBody(txt_qtn_voicemail_prompt);

voicemailNotification.setSummary(voicemailNotification.previewSummary());
voicemailNotification.setBody(voicemailNotification.previewBody());

voicemailNotification.setItemCount(voicemailCount);

Expand Down

0 comments on commit 4d64c43

Please sign in to comment.