Index: messageResponder.js |
diff --git a/messageResponder.js b/messageResponder.js |
index b8516d3b32f3d3a94fba8a4cfbc5b89a93090bdb..044673d90780145e88a1180560a66286450b2765 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"); |
Sebastian Noack
2017/10/08 01:35:35
You have to implement mocks for these APIs in back
kzar
2017/10/08 10:08:15
Whoops, Done.
|
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; |
+ |
+ notification.texts = NotificationStorage.getLocalizedTexts(notification, |
Sebastian Noack
2017/10/08 01:35:35
It seems inappropriate to modify the original obje
kzar
2017/10/08 10:08:15
Good point, Done.
|
+ message.locale); |
+ return notification; |
+ }); |
+ |
port.on("subscriptions.add", (message, sender) => |
{ |
let subscription = Subscription.fromURL(message.url); |