mautrix.client.state_store

class mautrix.client.state_store.StateStore

Bases: abc.ABC

async close()
Return type

None

async flush()
Return type

None

abstract async get_encryption_info(room_id)
Parameters

room_id (mautrix.types.RoomID) –

Return type

mautrix.types.RoomEncryptionStateEventContent | None

abstract async get_member(room_id, user_id)
Parameters
Return type

mautrix.types.Member | None

abstract async get_member_profiles(room_id, memberships=(Membership.JOIN, Membership.INVITE))
Parameters
Return type

dict[mautrix.types.UserID, mautrix.types.Member]

async get_members(room_id, memberships=(Membership.JOIN, Membership.INVITE))
Parameters
Return type

list[mautrix.types.UserID]

async get_members_filtered(room_id, not_prefix, not_suffix, not_id, memberships=(Membership.JOIN, Membership.INVITE))

A filtered version of get_members that only returns user IDs that aren’t operated by a bridge. This should return the same as get_members(), except users where the user ID is equal to not_id OR it starts with not_prefix AND ends with not_suffix.

The default implementation simply calls get_members(), but databases can implement this more efficiently.

Parameters
  • room_id (mautrix.types.RoomID) – The room ID to find.

  • not_prefix (str) – The user ID prefix to disallow.

  • not_suffix (str) – The user ID suffix to disallow.

  • not_id (str) – The user ID to disallow.

  • memberships (tuple[mautrix.types.Membership, ...]) – The membership states to include.

Return type

list[mautrix.types.UserID]

async get_membership(room_id, user_id)
Parameters
Return type

mautrix.types.Membership

abstract async get_power_levels(room_id)
Parameters

room_id (mautrix.types.RoomID) –

Return type

mautrix.types.PowerLevelStateEventContent | None

abstract async has_encryption_info_cached(room_id)
Parameters

room_id (mautrix.types.RoomID) –

Return type

bool

abstract async has_full_member_list(room_id)
Parameters

room_id (mautrix.types.RoomID) –

Return type

bool

async has_power_level(room_id, user_id, event_type)
Parameters
Return type

bool | None

abstract async has_power_levels_cached(room_id)
Parameters

room_id (mautrix.types.RoomID) –

Return type

bool

invited(room_id, user_id)
Parameters
Return type

Awaitable[None]

abstract async is_encrypted(room_id)
Parameters

room_id (mautrix.types.RoomID) –

Return type

bool | None

async is_joined(room_id, user_id)
Parameters
Return type

bool

joined(room_id, user_id)
Parameters
Return type

Awaitable[None]

left(room_id, user_id)
Parameters
Return type

Awaitable[None]

async open()
Return type

None

abstract async set_encryption_info(room_id, content)
Parameters
Return type

None

abstract async set_member(room_id, user_id, member)
Parameters
Return type

None

abstract async set_members(room_id, members, only_membership=None)
Parameters
Return type

None

abstract async set_membership(room_id, user_id, membership)
Parameters
Return type

None

abstract async set_power_levels(room_id, content)
Parameters
Return type

None

async update_state(evt)
Parameters

evt (mautrix.types.StateEvent) –

Return type

None

Implementations