Polyjuice Client v0.2.1 Polyjuice.Client.Filter View Source

Build filters.

https://matrix.org/docs/spec/client_server/r0.5.0#filtering

The functions in this module can be chained to create more complex filters.

Examples:

iex> Polyjuice.Client.Filter.include_state_types(["m.room.member"])
...> |> Polyjuice.Client.Filter.limit_timeline_events(10)
...> |> Polyjuice.Client.Filter.lazy_loading()
%{
  "room" => %{
    "state" => %{
      "types" => ["m.room.member"],
      "lazy_load_members" => true
    },
    "timeline" => %{
      "lazy_load_members" => true,
      "limit" => 10
    }
  }
}

Link to this section Summary

Functions

Don't allow certain types of ephemeral room events.

Don't allow certain types of presence events.

Don't allow certain types of state events.

Allow certain types of ephemeral room events to be included.

Allow certain types of presence events to be included.

Allow certain types of state events to be included.

Set the maximum number of timeline events.

Link to this section Functions

Link to this function

exclude_ephemeral_types(filter \\ %{}, types)

View Source
exclude_ephemeral_types(filter :: map(), types :: list()) :: map()

Don't allow certain types of ephemeral room events.

Link to this function

exclude_presence_types(filter \\ %{}, types)

View Source
exclude_presence_types(filter :: map(), types :: list()) :: map()

Don't allow certain types of presence events.

Link to this function

exclude_state_types(filter \\ %{}, types)

View Source
exclude_state_types(filter :: map(), types :: list()) :: map()

Don't allow certain types of state events.

Link to this function

include_ephemeral_types(filter \\ %{}, types)

View Source
include_ephemeral_types(filter :: map(), types :: list()) :: map()

Allow certain types of ephemeral room events to be included.

Link to this function

include_presence_types(filter \\ %{}, types)

View Source
include_presence_types(filter :: map(), types :: list()) :: map()

Allow certain types of presence events to be included.

Link to this function

include_state_types(filter \\ %{}, types)

View Source
include_state_types(filter :: map(), types :: list()) :: map()

Allow certain types of state events to be included.

Link to this function

lazy_loading(filter \\ %{})

View Source
lazy_loading(filter :: map()) :: map()
Link to this function

limit_timeline_events(filter \\ %{}, limit)

View Source
limit_timeline_events(filter :: map(), limit :: integer()) :: map()

Set the maximum number of timeline events.