MembershipService

interface MembershipService

This interface defines methods to handling membership. It's implemented at the room level.

Functions

Link copied to clipboard
abstract suspend fun areAllMembersLoaded(): Boolean

All the room members can be not loaded, for instance after an initial sync. All the members will be loaded when calling loadRoomMembersIfNeeded, or when sending an encrypted event to the room. The fun let the app know if all the members have been loaded for this room.

Link copied to clipboard
abstract fun areAllMembersLoadedLive(): LiveData<Boolean>

Live version for areAllMembersLoaded.

Link copied to clipboard
abstract suspend fun ban(userId: String, reason: String? = null)

Ban a user from the room.

Link copied to clipboard
abstract fun getNumberOfJoinedMembers(): Int
Link copied to clipboard
abstract fun getRoomMember(userId: String): RoomMemberSummary?

Return the roomMember with userId or null.

Link copied to clipboard
abstract fun getRoomMembers(queryParams: RoomMemberQueryParams): List<RoomMemberSummary>

Return all the roomMembers of the room with params.

Link copied to clipboard
abstract fun getRoomMembersLive(queryParams: RoomMemberQueryParams): LiveData<List<RoomMemberSummary>>

Return all the roomMembers of the room filtered by memberships.

Link copied to clipboard
abstract suspend fun invite(userId: String, reason: String? = null)

Invite a user in the room.

Link copied to clipboard
abstract suspend fun invite3pid(threePid: ThreePid)

Invite a user with email or phone number in the room.

Link copied to clipboard
open suspend fun kick(userId: String, reason: String? = null)
Link copied to clipboard
abstract suspend fun loadRoomMembersIfNeeded()

This methods load all room members if it was done yet.

Link copied to clipboard
abstract suspend fun remove(userId: String, reason: String? = null)

Remove a user from the room.

Link copied to clipboard
abstract suspend fun unban(userId: String, reason: String? = null)

Unban a user from the room.