diff options
| -rw-r--r-- | daemon/notificationmanager.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/daemon/notificationmanager.cpp b/daemon/notificationmanager.cpp index a04e99b..8e21ad9 100644 --- a/daemon/notificationmanager.cpp +++ b/daemon/notificationmanager.cpp @@ -6,6 +6,7 @@ #include <QSettings> #include <QDBusInterface> #include <QDBusPendingReply> +//#include "PersonalNotification.h" class NotificationManagerPrivate { @@ -123,21 +124,31 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons Q_ASSERT(calledFromDBus()); setDelayedReply(true); - QString category = hints.value("category", "").toString();
- QStringHash categoryParams = this->getCategoryParams(category);
-
- // Ignore transient notifications
- if (!category.endsWith("preview") && categoryParams.value("transient", "false") == "true") {
- qCDebug(l) << "Ignoring transient notification from " << owner;
- return 0;
- }
-
+ QString category = hints.value("category", "").toString(); + QStringHash categoryParams = this->getCategoryParams(category); + + // Ignore transient notifications (notif hints override category hints) + // Hack this to accept transient -preview and -summary notifications, as we don't know how to decode the actual notifs yet + if (!category.endsWith("preview") && !category.endsWith("summary") && + hints.value("transient", categoryParams.value("transient", "false")).toString() == "true") { + qCDebug(l) << "Ignoring transient notification from " << owner; + return 0; + } + if (app_name == "messageserver5" || owner == "messageserver5") { if (!settings->property("notificationsEmails").toBool()) { qCDebug(l) << "Ignoring email notification because of setting!"; return 0; } +// This is how we should obtain messaging notifications, if we manage to deserialize this 'PersonalNotification'. +// QByteArray commdata = hints.value("x-commhistoryd-data", "no data").toByteArray(); +// if (!commdata.contains((char)0)) +// data = QByteArray::fromBase64(commdata); +// QDataStream stream(commdata); +// stream.setVersion(QDataStream::Qt_5_0); +// stream >> + QString subject = hints.value("x-nemo-preview-summary", "").toString(); QString data = hints.value("x-nemo-preview-body", "").toString(); |
