SpaceService

interface SpaceService

Functions

Link copied to clipboard
abstract suspend fun createSpace(params: CreateSpaceParams): String

Create a space asynchronously.

abstract suspend fun createSpace(    name: String,     topic: String?,     avatarUri: Uri?,     isPublic: Boolean,     roomAliasLocalPart: String? = null): String

Just a shortcut for space creation for ease of use.

Link copied to clipboard
abstract suspend fun getRootSpaceSummaries(): List<RoomSummary>

Get the root spaces, i.e. all the spaces which do not have a parent space.

Link copied to clipboard
abstract fun getSpace(spaceId: String): Space?

Get a space from a spaceId.

Link copied to clipboard
abstract fun getSpaceSummaries(spaceSummaryQueryParams: SpaceSummaryQueryParams, sortOrder: RoomSortOrder = RoomSortOrder.NONE): List<RoomSummary>
Link copied to clipboard
abstract fun getSpaceSummariesLive(queryParams: SpaceSummaryQueryParams, sortOrder: RoomSortOrder = RoomSortOrder.NONE): LiveData<List<RoomSummary>>

Get a live list of space summaries. This list is refreshed as soon as the data changes.

Link copied to clipboard
abstract suspend fun joinSpace(    spaceIdOrAlias: String,     reason: String? = null,     viaServers: List<String> = emptyList()): JoinSpaceResult
Link copied to clipboard
abstract suspend fun leaveSpace(spaceId: String, reason: String? = null)

Leave the space, or reject an invitation.

Link copied to clipboard
abstract suspend fun peekSpace(spaceId: String): SpacePeekResult

Try to resolve (peek) rooms and subspace in this space. Use this call get preview of children of this space, particularly useful to get a preview of rooms that you did not join yet.

Link copied to clipboard
abstract suspend fun querySpaceChildren(    spaceId: String,     suggestedOnly: Boolean? = null,     limit: Int? = null,     from: String? = null,     knownStateList: List<SpaceChildSummaryEvent>? = null): SpaceHierarchyData

Get's information of a space by querying the server.

Link copied to clipboard
abstract suspend fun rejectInvite(spaceId: String, reason: String?)
Link copied to clipboard
abstract suspend fun removeSpaceParent(childRoomId: String, parentSpaceId: String)
Link copied to clipboard
abstract suspend fun setSpaceParent(    childRoomId: String,     parentSpaceId: String,     canonical: Boolean,     viaServers: List<String>)

Let this room declare that it has a parent.