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

Unified Diff: messageResponder.js

Issue 29559647: Issue 5808 - Easyprivacy URL is being shown instead of the title (Closed)
Patch Set: Created Sept. 29, 2017, 4:56 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
===================================================================
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -143,6 +143,20 @@
return listenerFilters;
}
+ function addSubscription(subscription, properties)
+ {
+ subscription.disabled = false;
+ if ("title" in properties)
+ subscription.title = properties.title;
+ if ("homepage" in properties)
+ subscription.homepage = properties.homepage;
+
+ FilterStorage.addSubscription(subscription);
+ if (subscription instanceof DownloadableSubscription &&
+ !subscription.lastDownload)
+ Synchronizer.execute(subscription);
+ }
+
port.on("app.get", (message, sender) =>
{
if (message.what == "issues")
@@ -331,13 +345,13 @@
port.on("subscriptions.add", (message, sender) =>
{
let subscription = Subscription.fromURL(message.url);
- if ("title" in message)
- subscription.title = message.title;
- if ("homepage" in message)
- subscription.homepage = message.homepage;
-
if (message.confirm)
{
+ if ("title" in message)
+ subscription.title = message.title;
+ if ("homepage" in message)
+ subscription.homepage = message.homepage;
+
ext.showOptions(() =>
{
sendMessage("app", "addSubscription", subscription);
@@ -345,12 +359,7 @@
}
else
{
- subscription.disabled = false;
- FilterStorage.addSubscription(subscription);
-
- if (subscription instanceof DownloadableSubscription &&
- !subscription.lastDownload)
- Synchronizer.execute(subscription);
+ addSubscription(subscription, message);
}
});
@@ -395,12 +404,7 @@
}
else
{
- subscription.disabled = false;
- subscription.title = message.title;
- subscription.homepage = message.homepage;
- FilterStorage.addSubscription(subscription);
- if (!subscription.lastDownload)
- Synchronizer.execute(subscription);
+ addSubscription(subscription, message);
}
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld