Index: lib/api.js |
diff --git a/lib/api.js b/lib/api.js |
index ca656b898f6680637d15e84a030a5c8b02986738..d558c5ff74ab2b35bad812b4b8bd0060257529e9 100644 |
--- a/lib/api.js |
+++ b/lib/api.js |
@@ -137,6 +137,37 @@ var API = (function() |
return result; |
}, |
+ isAASubscription: function(subscription) |
+ { |
+ return subscription.url == Prefs.subscriptions_exceptionsurl; |
+ }, |
+ |
+ setAASubscriptionEnabled: function(enabled) |
+ { |
+ var aaSubscription = FilterStorage.subscriptions.find(API.isAASubscription); |
+ if (!enabled) |
+ { |
+ if (aaSubscription && !aaSubscription.disabled) |
+ aaSubscription.disabled = true; |
+ return; |
+ } |
+ if (!aaSubscription) |
+ { |
+ aaSubscription = Subscription.fromURL(Prefs.subscriptions_exceptionsurl); |
+ FilterStorage.addSubscription(aaSubscription); |
+ } |
+ if (aaSubscription.disabled) |
+ aaSubscription.disabled = false; |
+ if (!aaSubscription.lastDownload) |
+ Synchronizer.execute(aaSubscription); |
+ }, |
+ |
+ isAASubscriptionEnabled: function() |
+ { |
+ var aaSubscription = FilterStorage.subscriptions.find(API.isAASubscription); |
+ return aaSubscription && !aaSubscription.disabled; |
+ }, |
+ |
showNextNotification: function(url) |
{ |
Notification.showNext(url); |
@@ -181,7 +212,7 @@ var API = (function() |
getHostFromUrl: function(url) |
{ |
- return extractHostFromURL(url); |
+ return extractHostFromURL(url); |
}, |
compareVersions: function(v1, v2) |