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

Unified Diff: adblockplus/Api.jsm

Issue 29323406: Issue 2871 - Honor the disabled flag for subscriptions (Closed)
Patch Set: Created Aug. 7, 2015, 10:52 a.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: adblockplus/Api.jsm
diff --git a/adblockplus/Api.jsm b/adblockplus/Api.jsm
index 4d0de801f630c90cb78a8bd25ecbfcbac01bf5eb..c8c261c9d50c5ecaf2b6959f5945b57d8f15f360 100644
--- a/adblockplus/Api.jsm
+++ b/adblockplus/Api.jsm
@@ -93,13 +93,18 @@ var AdblockPlusApi =
},
addSubscription: function(url, title)
{
- let subscription = Subscription.fromURL(url);
+ let subscriptionToAdd = Subscription.fromURL(url);
if (title)
- subscription.title = title;
- FilterStorage.addSubscription(subscription);
- if (!subscription.lastDownload)
+ subscriptionToAdd.title = title;
+ FilterStorage.addSubscription(subscriptionToAdd);
+ let subscription = FilterStorage.knownSubscriptions[url];
+ if (subscription)
{
- Synchronizer.execute(subscription);
+ subscription.disabled = false;
+ if (!subscription.lastDownload)
+ {
+ Synchronizer.execute(subscription);
+ }
}
},
removeSubscription: function(url)
@@ -113,7 +118,8 @@ var AdblockPlusApi =
for (let i = 0; i < FilterStorage.subscriptions.length; i++)
{
let subscription = FilterStorage.subscriptions[i];
- subscriptions.push({"title": subscription.title, "url": subscription.url});
+ if (!subscription.disabled)
+ subscriptions.push({"title": subscription.title, "url": subscription.url});
}
return subscriptions;
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld