Index: messageResponder.js |
diff --git a/messageResponder.js b/messageResponder.js |
index b8516d3b32f3d3a94fba8a4cfbc5b89a93090bdb..7c5458150b65a731532e3e53aa37a41286b4c9a5 100644 |
--- a/messageResponder.js |
+++ b/messageResponder.js |
@@ -28,6 +28,7 @@ |
const {FilterNotifier} = require("filterNotifier"); |
const {defaultMatcher} = require("matcher"); |
const {Notification: NotificationStorage} = require("notification"); |
+ const {getActiveNotification, shouldDisplay} = require("notificationHelper"); |
const {Filter, BlockingFilter, RegExpFilter} = require("filterClasses"); |
const {Synchronizer} = require("synchronizer"); |
@@ -342,6 +343,20 @@ |
return Prefs[message.key] = !Prefs[message.key]; |
}); |
+ port.on("notifications.get", (message, sender) => |
+ { |
+ let notification = getActiveNotification(); |
+ |
+ if (!notification || |
+ "displayMethod" in message && |
+ !shouldDisplay(message.displayMethod, notification.type)) |
+ return; |
+ |
+ let texts = NotificationStorage.getLocalizedTexts(notification, |
+ message.locale); |
+ return Object.assign({}, notification, {texts}); |
Thomas Greiner
2017/10/09 10:52:59
Detail: The third argument is redundant because yo
kzar
2017/10/09 11:13:51
Good point, Done.
|
+ }); |
+ |
port.on("subscriptions.add", (message, sender) => |
{ |
let subscription = Subscription.fromURL(message.url); |