summaryrefslogtreecommitdiff
path: root/daemon/notificationmanager.cpp
diff options
context:
space:
mode:
authorPhilipp Andreas <github@smurfy.de>2014-07-12 10:01:23 +0200
committerPhilipp Andreas <github@smurfy.de>2014-07-12 10:01:23 +0200
commit851dfd95c158607a25c35ce25f97f80a3f57ad74 (patch)
treea06c546ff6ccc29e435484baa99823598dc4694d /daemon/notificationmanager.cpp
parentb8e1190847ff8cad9276bc1bc751aef454a713d4 (diff)
Changed notifications prio and added a error logging
Diffstat (limited to 'daemon/notificationmanager.cpp')
-rw-r--r--daemon/notificationmanager.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/daemon/notificationmanager.cpp b/daemon/notificationmanager.cpp
index 8524083..a0a99e0 100644
--- a/daemon/notificationmanager.cpp
+++ b/daemon/notificationmanager.cpp
@@ -97,7 +97,7 @@ void NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
if (app_name == "messageserver5") {
emit this->emailNotify(hints.value("x-nemo-preview-summary", detectCleanAppname(app_name)).toString(),
- hints.value("x-nemo-preview-body", "").toString(),
+ hints.value("x-nemo-preview-body", "default").toString(),
""
);
} else if (app_name == "commhistoryd") {
@@ -107,18 +107,29 @@ void NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
);
}
} else {
- QString data = summary;
- QString subject = body;
- if (data.isEmpty()) {
- data = hints.value("x-nemo-preview-summary", "").toString();
- }
+ //Prioritize x-nemo-preview* over dbus direct summary and body
+ QString subject = hints.value("x-nemo-preview-summary", "").toString();
+ QString data = hints.value("x-nemo-preview-body", "").toString();
+
if (subject.isEmpty()) {
- subject = hints.value("x-nemo-preview-body", "").toString();
+ subject = summary;
+ }
+ if (data.isEmpty()) {
+ data = body;
}
+
+ //Prioritize data over subject
if (data.isEmpty() && !subject.isEmpty()) {
data = subject;
subject = "";
}
+
+ //Never send empty data and subject
+ if (data.isEmpty() && subject.isEmpty()) {
+ logger()->warn() << Q_FUNC_INFO << "Empty subject and data in dbus app " << app_name;
+ return;
+ }
+
emit this->emailNotify(detectCleanAppname(app_name), data, subject);
}
}