Module: filterListener

Classes

FilterListener

Members

(package, static) filterListener :module:filterListener~FilterListener

Component synchronizing filter storage with the filter engine.

Type:
Source:

Methods

(inner) deployFilter(engine, filter, subscriptionsopt, nullable)

Deploys a filter to the filter engine.

The filter is deployed only if it belongs to at least one subscription that is both valid and enabled.

If the filter is a snippet filter, or a block filter with the $header options, it is deployed only if it belongs to at least one subscription that is valid, enabled, and of type circumvention or a special subscription that keeps user-defined filters.

Parameters:
Name Type Attributes Default Description
engine module:filterEngine~FilterEngine

A reference to the filter engine.

filter Filter

The filter.

subscriptions Array.<module:subscriptionClasses.Subscription> <optional>
<nullable>
null

A list of subscriptions to which the filter belongs. If omitted or null, the information is looked up from filter storage.

Source:

(inner) shouldDeployFilters(subscription) → {boolean}

Checks whether filters from a given subscription should be deployed to the filter engine.

If the subscription is both valid and enabled, the function returns true; otherwise, it returns false.

Parameters:
Name Type Description
subscription module:subscriptionClasses.Subscription

The subscription.

Source:
Returns:

Whether filters from the subscription should be deployed to the filter engine.

Type
boolean

(inner) undeployFilter(engine, filter)

Undeploys a filter from the filter engine.

The filter is undeployed only if it does not belong to at least one subscription that is both valid and enabled.

Parameters:
Name Type Description
engine module:filterEngine~FilterEngine

A reference to the filter engine.

filter module:filterClasses.Filter

The filter.

Source: