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, 2:24 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, message)
Thomas Greiner 2017/09/29 16:39:18 Detail: The name "message" here is quite generic.
saroyanm 2017/09/29 16:58:56 Done.
+ {
+ subscription.disabled = false;
+ if ("title" in message)
saroyanm 2017/09/29 14:35:17 Lack of this check were causing the unexpected beh
Thomas Greiner 2017/09/29 16:39:18 The URL is used as a fallback whenever there's no
saroyanm 2017/09/29 16:58:56 I see, thanks for the info.
+ subscription.title = message.title;
+ if ("homepage" in message)
+ subscription.homepage = message.homepage;
+
+ FilterStorage.addSubscription(subscription);
+ if (subscription instanceof DownloadableSubscription &&
saroyanm 2017/09/29 14:35:17 Previously we were not checking if it's a Download
Thomas Greiner 2017/09/29 16:39:18 Acknowledged.
+ !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