Class: Filter

filter~Filter

new Filter(userId, filterIdopt)

Construct a new Filter.
Parameters:
Name Type Attributes Description
userId string The user ID for this filter.
filterId string <optional>
The filter ID if known.
Properties:
Name Type Attributes Description
userId string The user ID of the filter
filterId string <nullable>
The filter ID
Source:

Methods

(static) fromJson(userId, filterId, jsonObj) → {Filter}

Create a filter from existing data.
Parameters:
Name Type Description
userId string
filterId string
jsonObj Object
Source:
Returns:
Type
Filter

filterRoomTimeline(events) → {Array.<MatrixEvent>}

Filter the list of events based on whether they are allowed in a timeline based on this filter
Parameters:
Name Type Description
events Array.<MatrixEvent> the list of events being filtered
Source:
Returns:
the list of events which match the filter
Type
Array.<MatrixEvent>

getDefinition() → {Object}

Get the JSON body of the filter.
Source:
Returns:
The filter definition
Type
Object

getFilterId() → (nullable) {Number}

Get the ID of this filter on your homeserver (if known)
Source:
Returns:
The filter ID
Type
Number

getRoomTimelineFilterComponent() → {FilterComponent}

Get the room.timeline filter component of the filter
Source:
Returns:
room timeline filter component
Type
FilterComponent

setDefinition(definition)

Set the JSON body of the filter
Parameters:
Name Type Description
definition Object The filter definition
Source:

setIncludeLeaveRooms(includeLeave)

Control whether left rooms should be included in responses.
Parameters:
Name Type Description
includeLeave boolean True to make rooms the user has left appear in responses.
Source:

setTimelineLimit(limit)

Set the max number of events to return for each room's timeline.
Parameters:
Name Type Description
limit Number The max number of events to return for each room.
Source: