Index: messageResponder.js |
=================================================================== |
--- a/messageResponder.js |
+++ b/messageResponder.js |
@@ -306,17 +306,17 @@ |
{ |
FilterStorage.addFilter(filter); |
seenFilter[filter.text] = null; |
} |
if (!message.removeExisting) |
return errors; |
- for (const subscription of FilterStorage.subscriptions) |
+ for (const subscription of FilterStorage.knownSubscriptions.values()) |
{ |
if (!(subscription instanceof SpecialSubscription)) |
continue; |
for (let j = subscription.filters.length - 1; j >= 0; j--) |
{ |
const filter = subscription.filters[j]; |
if (/^@@\|\|([^/:]+)\^\$document$/.test(filter.text)) |
@@ -401,26 +401,27 @@ |
else |
{ |
addSubscription(subscription, message); |
} |
}); |
port.on("subscriptions.get", (message, sender) => |
{ |
- const subscriptions = FilterStorage.subscriptions.filter((s) => |
- { |
- if (message.ignoreDisabled && s.disabled) |
+ const subscriptions = [ |
+ ...FilterStorage.knownSubscriptions.values()].filter((s) => |
+ { |
+ if (message.ignoreDisabled && s.disabled) |
+ return false; |
+ if (s instanceof DownloadableSubscription && message.downloadable) |
+ return true; |
+ if (s instanceof SpecialSubscription && message.special) |
+ return true; |
return false; |
- if (s instanceof DownloadableSubscription && message.downloadable) |
- return true; |
- if (s instanceof SpecialSubscription && message.special) |
- return true; |
- return false; |
- }); |
+ }); |
return subscriptions.map((s) => |
{ |
const result = convertSubscription(s); |
if (message.disabledFilters) |
{ |
result.disabledFilters = s.filters |
.filter((f) => f instanceof ActiveFilter && f.disabled) |