StateService

interface StateService

Functions

Link copied to clipboard
abstract suspend fun deleteAvatar()

Delete the avatar of the room.

Link copied to clipboard
abstract fun getStateEvent(eventType: String, stateKey: QueryStateEventValue): Event?

Get a state event of the room.

Link copied to clipboard
abstract fun getStateEventLive(eventType: String, stateKey: QueryStateEventValue): LiveData<Optional<Event>>

Get a live state event of the room.

Link copied to clipboard
abstract fun getStateEvents(eventTypes: Set<String>, stateKey: QueryStateEventValue): List<Event>

Get state events of the room.

Link copied to clipboard
abstract fun getStateEventsLive(eventTypes: Set<String>, stateKey: QueryStateEventValue): LiveData<List<Event>>

Get live state events of the room.

Link copied to clipboard
abstract suspend fun sendStateEvent(    eventType: String,     stateKey: String,     body: JsonDict): String

Send a state event to the room.

Link copied to clipboard
abstract suspend fun setJoinRuleInviteOnly()
Link copied to clipboard
abstract suspend fun setJoinRulePublic()
Link copied to clipboard
abstract suspend fun setJoinRuleRestricted(allowList: List<String>)
Link copied to clipboard
abstract suspend fun updateAvatar(avatarUri: Uri, fileName: String)

Update the avatar of the room.

Link copied to clipboard
abstract suspend fun updateCanonicalAlias(alias: String?, altAliases: List<String>)

Update the canonical alias of the room.

Link copied to clipboard
abstract suspend fun updateHistoryReadability(readability: RoomHistoryVisibility)

Update the history readability of the room.

Link copied to clipboard
abstract suspend fun updateJoinRule(    joinRules: RoomJoinRules?,     guestAccess: GuestAccess?,     allowList: List<RoomJoinRulesAllowEntry>? = null)

Update the join rule and/or the guest access.

Link copied to clipboard
abstract suspend fun updateName(name: String)

Update the name of the room.

Link copied to clipboard
abstract suspend fun updateTopic(topic: String)

Update the topic of the room.

Extensions

Link copied to clipboard
fun StateService.isPublic(): Boolean

Return true if a room can be joined by anyone (RoomJoinRules.PUBLIC).