From 72b25f2b7df4140313fdee6798b323b4b623f95d Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Thu, 22 Aug 2013 04:38:04 +0200 Subject: [PATCH] Mark request answers as so, to not show the notifications as new --- .../java/org/kde/connect/Plugins/NotificationsPlugin.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/KdeConnect/src/main/java/org/kde/connect/Plugins/NotificationsPlugin.java b/KdeConnect/src/main/java/org/kde/connect/Plugins/NotificationsPlugin.java index 9ad25eb4..8259c0df 100644 --- a/KdeConnect/src/main/java/org/kde/connect/Plugins/NotificationsPlugin.java +++ b/KdeConnect/src/main/java/org/kde/connect/Plugins/NotificationsPlugin.java @@ -171,6 +171,10 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver. @Override public void onNotificationPosted(StatusBarNotification statusBarNotification) { + onNotificationPosted(statusBarNotification, false); + } + + public void onNotificationPosted(StatusBarNotification statusBarNotification, boolean requestAnswer) { Notification notification = statusBarNotification.getNotification(); NotificationId id = NotificationId.fromNotification(statusBarNotification); @@ -201,6 +205,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver. np.set("isClearable", statusBarNotification.isClearable()); np.set("ticker", notification.tickerText.toString()); np.set("time", new Long(statusBarNotification.getPostTime()).toString()); + if (requestAnswer) np.set("requestAnswer", true); device.sendPackage(np); } @@ -220,7 +225,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver. public void onServiceStart(NotificationReceiver service) { StatusBarNotification[] notifications = service.getActiveNotifications(); for (StatusBarNotification notification : notifications) { - onNotificationPosted(notification); + onNotificationPosted(notification, true); } } });