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; |
}, |