From 8809372b67b12780d448f3a303c9f47746e31042 Mon Sep 17 00:00:00 2001 From: "Sebastian J. Wolf" Date: Thu, 3 Sep 2020 23:20:46 +0200 Subject: [PATCH] Backend can really send notifications --- harbour-fernschreiber.pro | 2 ++ images/fernschreiber-notification.png | Bin 0 -> 19466 bytes src/notificationmanager.cpp | 50 +++++++++++++++++++++++++- src/notificationmanager.h | 3 ++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 images/fernschreiber-notification.png diff --git a/harbour-fernschreiber.pro b/harbour-fernschreiber.pro index 990d921..ebc9869 100644 --- a/harbour-fernschreiber.pro +++ b/harbour-fernschreiber.pro @@ -14,6 +14,8 @@ TARGET = harbour-fernschreiber CONFIG += sailfishapp sailfishapp_i18n +PKGCONFIG += nemonotifications-qt5 + QT += core dbus SOURCES += src/harbour-fernschreiber.cpp \ diff --git a/images/fernschreiber-notification.png b/images/fernschreiber-notification.png new file mode 100644 index 0000000000000000000000000000000000000000..bc4e29cab79204ac7a4b6b75feb7ce68186c311c GIT binary patch literal 19466 zcmV)ZK&!urP)WFU8GbZ8()Nlj2>E@cM*03ZNKL_t(|+U=cpm{rxe z|3B-@3>}89q6i4qXjBj(RuIIFCPqO8B*kB%f-x~S&4xzPOrjA@yqbHjiXd2`#;!4H zY!rJ%iZoH_9cGw0vwnZwi z@()#7f}LaNp&X5(2B-s$K+`^SckBPABX(c07I+oN02S(KUMj6_3FxJf7I24vdaeM- z&;#hx;9qZ`bCVs7266If(2@791m*+tw*6BqQcvXxfj$w`Q>DEt0lhR5L9K_dA8=R> z)Tg89zYVxruxl>Ybj&?T*I^clM}S3WURO^s8$h1~>dDd`mw^6N1om;D{=E&@1JRs- z;uN62)s7``ac!{E_COE2HVb$h#nb8urk8+U0{YGk?7^U(-v;u5zzM)fCIv=v(5HZUymWR-K>w0(ZatU|D9!~&0|R2glVmtc6NIjMy)SWJZ{zlpfGO&6)|5bB z0{V^&^ijYF;8ZXAvMmUG>E&q>f%xl>0n^mu0jDpG63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_F6%SSJ}o^~YM*f7(ypA|B=mQC2DF&Y&o!0Q zrptz8+@3kijshzwAMVqK(21$r6xdE4>Av!<)nKk3!vH_N=Kc=XfDd(piAnoWn(IY8F>&`88fAC*?6M8HQB zm#d}Kmx!6Re>e^Rt_RbkF@g^%&qghgdR(OHi|f9)WsA&OmqclpR hG)kj1N@FJ;{~x)&eun$vs+|A;002ovPDHLkV1mMeSvLRx literal 0 HcmV?d00001 diff --git a/src/notificationmanager.cpp b/src/notificationmanager.cpp index bb8fa2f..812ce68 100644 --- a/src/notificationmanager.cpp +++ b/src/notificationmanager.cpp @@ -18,6 +18,11 @@ */ #include "notificationmanager.h" +#include +#include +#include +#include +#include NotificationManager::NotificationManager(TDLibWrapper *tdLibWrapper, QObject *parent) : QObject(parent) { @@ -42,7 +47,32 @@ void NotificationManager::handleUpdateActiveNotifications(const QVariantList not void NotificationManager::handleUpdateNotificationGroup(const QVariantMap notificationGroupUpdate) { - qDebug() << "[NotificationManager] Received notification group update, group ID:" << notificationGroupUpdate.value("notification_group_id").toInt(); + QString notificationGroupId = notificationGroupUpdate.value("notification_group_id").toString(); + qDebug() << "[NotificationManager] Received notification group update, group ID:" << notificationGroupId; + QVariantMap notificationGroup = this->notificationGroups.value(notificationGroupId).toMap(); + + notificationGroup.insert("type", notificationGroupUpdate.value("type")); + notificationGroup.insert("chat_id", notificationGroupUpdate.value("chat_id")); + notificationGroup.insert("notification_settings_chat_id", notificationGroupUpdate.value("notification_settings_chat_id")); + notificationGroup.insert("is_silent", notificationGroupUpdate.value("is_silent")); + notificationGroup.insert("total_count", notificationGroupUpdate.value("total_count")); + + QVariantMap notifications = notificationGroup.value("notifications").toMap(); + QVariantList addedNotifications = notificationGroupUpdate.value("added_notifications").toList(); + QListIterator addedNotificationIterator(addedNotifications); + while (addedNotificationIterator.hasNext()) { + QVariantMap addedNotification = addedNotificationIterator.next().toMap(); + notifications.insert(addedNotification.value("id").toString(), addedNotification); + } + QVariantList removedNotifications = notificationGroupUpdate.value("removed_notification_ids").toList(); + QListIterator removedNotificationIterator(removedNotifications); + while (removedNotificationIterator.hasNext()) { + QString removedNotificationId = removedNotificationIterator.next().toString(); + notifications.remove(removedNotificationId); + } + notificationGroup.insert("notifications", notifications); + this->notificationGroups.insert(notificationGroupId, notificationGroup); + // this->sendNotifications(); } void NotificationManager::handleUpdateNotification(const QVariantMap updatedNotification) @@ -57,3 +87,21 @@ void NotificationManager::handleChatDiscovered(const QString &chatId, const QVar this->chatMap.insert(chatId, chatInformation); this->chatListMutex.unlock(); } + +void NotificationManager::sendNotifications() +{ + QVariantList notificationGroupList = this->notificationGroups.values(); + QListIterator notificationGroupIterator(notificationGroupList); + QUrl appIconUrl = SailfishApp::pathTo("images/fernschreiber-notification.png"); + while (notificationGroupIterator.hasNext()) { + QVariantMap notificationGroup = notificationGroupIterator.next().toMap(); + Notification nemoNotification; + nemoNotification.setAppName("Fernschreiber"); + nemoNotification.setAppIcon(appIconUrl.toLocalFile()); + nemoNotification.setBody("This is the body"); + nemoNotification.setSummary("This is the summary"); + nemoNotification.setPreviewSummary("This is the preview summary"); + nemoNotification.setPreviewBody("This is the preview body"); + nemoNotification.publish(); + } +} diff --git a/src/notificationmanager.h b/src/notificationmanager.h index c28d0c7..3117372 100644 --- a/src/notificationmanager.h +++ b/src/notificationmanager.h @@ -45,8 +45,11 @@ private: TDLibWrapper *tdLibWrapper; QVariantMap chatMap; + QVariantMap notificationGroups; QMutex chatListMutex; + void sendNotifications(); + }; #endif // NOTIFICATIONMANAGER_H