summaryrefslogtreecommitdiff
path: root/daemon/notificationmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/notificationmanager.cpp')
-rw-r--r--daemon/notificationmanager.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/daemon/notificationmanager.cpp b/daemon/notificationmanager.cpp
index d983539..e485703 100644
--- a/daemon/notificationmanager.cpp
+++ b/daemon/notificationmanager.cpp
@@ -117,7 +117,10 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
return 0;
}
- qCDebug(l) << Q_FUNC_INFO << "Got notification via dbus from" << this->getCleanAppName(app_name);
+ // new place to check notification owner in Sailfish 1.1.6
+ QString owner = hints.value("x-nemo-owner").toString();
+
+ qCDebug(l) << Q_FUNC_INFO << "Got notification via dbus from" << this->getCleanAppName(app_name) << " Owner: " << owner;
qCDebug(l) << hints;
// Avoid sending a reply for this method call, since we've received it because we're eavesdropping.
@@ -125,9 +128,8 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
Q_ASSERT(calledFromDBus());
setDelayedReply(true);
- if (app_name == "messageserver5") {
- QVariant notificationsEmails = settings->property("notificationsEmails");
- if (!notificationsEmails.isValid() || !notificationsEmails.toBool()) {
+ if (app_name == "messageserver5" || owner == "messageserver5") {
+ if (!settings->property("notificationsEmails").toBool()) {
qCDebug(l) << "Ignoring email notification because of setting!";
return 0;
}
@@ -144,19 +146,17 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
if (!subject.isEmpty()) {
emit this->emailNotify(subject, data, "");
}
- } else if (app_name == "commhistoryd") {
+ } else if (app_name == "commhistoryd" || owner == "commhistoryd") {
if (summary == "" && body == "") {
QString category = hints.value("category", "").toString();
if (category == "x-nemo.call.missed") {
- QVariant notificationsMissedCall = settings->property("notificationsMissedCall");
- if (notificationsMissedCall.isValid() && !notificationsMissedCall.toBool()) {
+ if (!settings->property("notificationsMissedCall").toBool()) {
qCDebug(l) << "Ignoring MissedCall notification because of setting!";
return 0;
}
} else {
- QVariant notificationsCommhistoryd = settings->property("notificationsCommhistoryd");
- if (notificationsCommhistoryd.isValid() && !notificationsCommhistoryd.toBool()) {
+ if (!settings->property("notificationsCommhistoryd").toBool()) {
qCDebug(l) << "Ignoring commhistoryd notification because of setting!";
return 0;
}
@@ -165,9 +165,8 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
hints.value("x-nemo-preview-body", "default").toString()
);
}
- } else if (app_name == "harbour-mitakuuluu2-server") {
- QVariant notificationsMitakuuluu = settings->property("notificationsMitakuuluu");
- if (notificationsMitakuuluu.isValid() && !notificationsMitakuuluu.toBool()) {
+ } else if (app_name == "harbour-mitakuuluu2-server" || owner == "harbour-mitakuuluu2-server") {
+ if (!settings->property("notificationsMitakuuluu").toBool()) {
qCDebug(l) << "Ignoring mitakuuluu notification because of setting!";
return 0;
}
@@ -175,9 +174,8 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
emit this->smsNotify(hints.value("x-nemo-preview-body", "default").toString(),
hints.value("x-nemo-preview-summary", "default").toString()
);
- } else if (app_name == "twitter-notifications-client") {
- QVariant notificationsTwitter = settings->property("notificationsTwitter");
- if (notificationsTwitter.isValid() && !notificationsTwitter.toBool()) {
+ } else if (app_name == "twitter-notifications-client" || owner == "twitter-notifications-client") {
+ if (!settings->property("notificationsTwitter").toBool()) {
qCDebug(l) << "Ignoring twitter notification because of setting!";
return 0;
}
@@ -195,14 +193,12 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
qCDebug(l) << "MSG Prio:" << prio;
- QVariant notificationsAll = settings->property("notificationsAll");
- if ((!notificationsAll.isValid() || !notificationsAll.toBool()) && prio <= 10) {
+ if (!settings->property("notificationsAll").toBool() && prio <= 10) {
qCDebug(l) << "Ignoring notification because of setting! (all)";
return 0;
}
- QVariant notificationsOther = settings->property("notificationsOther");
- if (notificationsOther.isValid() && !notificationsOther.toBool() && prio < 90) {
+ if (!settings->property("notificationsOther").toBool() && prio < 90) {
qCDebug(l) << "Ignoring notification because of setting! (other)";
return 0;
}