Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: messageResponder.js

Issue 29567743: Issue 5835 - Add some notification related message handlers (Closed)
Patch Set: Created Oct. 6, 2017, 12:59 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: messageResponder.js
diff --git a/messageResponder.js b/messageResponder.js
index b8516d3b32f3d3a94fba8a4cfbc5b89a93090bdb..baf0d5897fea8e5634953f243fa5d9266529124e 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,24 @@
return Prefs[message.key] = !Prefs[message.key];
});
+ port.on(
+ "notifications.getActive",
+ (message, sender) => getActiveNotification()
+ );
+
+ port.on(
+ "notifications.shouldDisplay",
+ (message, sender) => shouldDisplay(message.method, message.notificationType)
+ );
+
+ port.on(
+ "notifications.getLocalizedTexts",
+ (message, sender) =>
+ NotificationStorage.getLocalizedTexts(
+ message.notification, message.locale
+ )
+ );
+
port.on("subscriptions.add", (message, sender) =>
{
let subscription = Subscription.fromURL(message.url);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld