Package org.matrix.android.sdk.api.session.room.model

Types

Link copied to clipboard
data class EditAggregatedSummary(    val latestEdit: Event? = null,     val sourceEvents: List<String>,     val localEchos: List<String>,     val lastEditTs: Long = 0)
Link copied to clipboard
data class EventAnnotationsSummary(    val reactionsSummary: List<ReactionAggregatedSummary> = emptyList(),     val editSummary: EditAggregatedSummary? = null,     val pollResponseSummary: PollResponseAggregatedSummary? = null,     val referencesAggregatedSummary: ReferencesAggregatedSummary? = null,     val liveLocationShareAggregatedSummary: LiveLocationShareAggregatedSummary? = null)
Link copied to clipboard
@JsonClass(generateAdapter = false)
enum GuestAccess : Enum<GuestAccess>
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class Invite(@Json(name = "display_name") val displayName: String, @Json(name = "signed") val signed: Signed)

Subclass representing a search API response.

Link copied to clipboard
enum LocalRoomCreationState : Enum<LocalRoomCreationState>
Link copied to clipboard
data class LocalRoomSummary(    val roomId: String,     val roomSummary: RoomSummary?,     val createRoomParams: CreateRoomParams?,     val replacementRoomId: String?,     val creationState: LocalRoomCreationState)

This class holds some data of a local room. It can be retrieved by org.matrix.android.sdk.api.session.room.Room and org.matrix.android.sdk.api.session.room.RoomService

Link copied to clipboard
@JsonClass(generateAdapter = false)
enum Membership : Enum<Membership>

Represents the membership of a user on a room.

Link copied to clipboard
data class PollResponseAggregatedSummary(    val aggregatedContent: PollSummaryContent? = null,     val closedTime: Long? = null,     val nbOptions: Int = 0,     val sourceEvents: List<String>,     val localEchos: List<String>,     val encryptedRelatedEventIds: List<String>)
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class PollSummaryContent(    val myVote: String? = null,     val votes: List<VoteInfo>? = null,     val votesSummary: Map<String, VoteSummary>? = null,     val totalVotes: Int = 0,     val winnerVoteCount: Int = 0)

Contains an aggregated summary info of the poll response. Put pre-computed info that you want to access quickly without having to go through all references events

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class PowerLevelsContent(    @Json(name = "ban") val ban: Int? = null,     @Json(name = "kick") val kick: Int? = null,     @Json(name = "invite") val invite: Int? = null,     @Json(name = "redact") val redact: Int? = null,     @Json(name = "events_default") val eventsDefault: Int? = null,     @Json(name = "events") val events: Map<String, Int>? = null,     @Json(name = "users_default") val usersDefault: Int? = null,     @Json(name = "users") val users: Map<String, Int>? = null,     @Json(name = "state_default") val stateDefault: Int? = null,     @Json(name = "notifications") val notifications: Map<String, Any>? = null)

Class representing the EventType.EVENT_TYPE_STATE_ROOM_POWER_LEVELS state event content.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class PublicKeys(@Json(name = "key_validity_url") val keyValidityUrl: String? = null, @Json(name = "public_key") val publicKey: String)
Link copied to clipboard
data class ReactionAggregatedSummary(    val key: String,     val count: Int,     val addedByMe: Boolean,     val firstTimestamp: Long,     val sourceEvents: List<String>,     val localEchoEvents: List<String>)
Link copied to clipboard
data class ReadReceipt(    val roomMember: RoomMemberSummary,     val originServerTs: Long,     val threadId: String?)
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class ReferencesAggregatedContent(@Json(name = "verif_sum") val verificationState: VerificationState)

Contains an aggregated summary info of the references. Put pre-computed info that you want to access quickly without having to go through all references events

Link copied to clipboard
data class ReferencesAggregatedSummary(    val content: Content?,     val sourceEvents: List<String>,     val localEchos: List<String>)

Events can relates to other events, this object keeps a summary of all events that are referencing the 'eventId' event via the RelationType.REFERENCE.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomAliasesContent(@Json(name = "aliases") val aliases: List<String> = emptyList())

Class representing the EventType.STATE_ROOM_ALIASES state event content Note that this Event has been deprecated, see

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomAvatarContent(@Json(name = "url") val avatarUrl: String? = null)

Class representing the EventType.STATE_ROOM_AVATAR state event content.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomCanonicalAliasContent(@Json(name = "alias") val canonicalAlias: String? = null, @Json(name = "alt_aliases") val alternativeAliases: List<String>? = null)

Class representing the EventType.STATE_ROOM_CANONICAL_ALIAS state event content.

Link copied to clipboard
@JsonClass(generateAdapter = false)
enum RoomDirectoryVisibility : Enum<RoomDirectoryVisibility>
Link copied to clipboard
sealed class RoomEncryptionAlgorithm
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomGuestAccessContent(@Json(name = "guest_access") val guestAccessStr: String? = null)

Class representing the EventType.STATE_ROOM_GUEST_ACCESS state event content Ref: https://matrix.org/docs/spec/client_server/latest#m-room-guest-access

Link copied to clipboard
@JsonClass(generateAdapter = false)
enum RoomHistoryVisibility : Enum<RoomHistoryVisibility>

Ref: https://matrix.org/docs/spec/client_server/latest#room-history-visibility

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomHistoryVisibilityContent(@Json(name = "history_visibility") val historyVisibilityStr: String? = null)
Link copied to clipboard
@JsonClass(generateAdapter = false)
enum RoomJoinRules : Enum<RoomJoinRules>

Enum for RoomJoinRulesContent : https://matrix.org/docs/spec/client_server/r0.4.0#m-room-join-rules

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomJoinRulesAllowEntry(@Json(name = "room_id") val roomId: String?, @Json(name = "type") val type: String?)
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomJoinRulesContent(@Json(name = "join_rule") val joinRulesStr: String? = null, @Json(name = "allow") val allowList: List<RoomJoinRulesAllowEntry>? = null)

Class representing the EventType.STATE_ROOM_JOIN_RULES state event content.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomMemberContent(    @Json(name = "membership") val membership: Membership,     @Json(name = "reason") val reason: String? = null,     @Json(name = "displayname") val displayName: String? = null,     @Json(name = "avatar_url") val avatarUrl: String? = null,     @Json(name = "is_direct") val isDirect: Boolean = false,     @Json(name = "third_party_invite") val thirdPartyInvite: Invite? = null,     @Json(name = "unsigned") val unsignedData: UnsignedData? = null)

Class representing the EventType.STATE_ROOM_MEMBER state event content.

Link copied to clipboard
data class RoomMemberSummary(    val membership: Membership,     val userId: String,     val userPresence: UserPresence? = null,     val displayName: String? = null,     val avatarUrl: String? = null)

Class representing a simplified version of EventType.STATE_ROOM_MEMBER state event content.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomNameContent(@Json(name = "name") val name: String? = null)

Class representing the EventType.STATE_ROOM_NAME state event content.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomServerAclContent(    @Json(name = "allow_ip_literals") val allowIpLiterals: Boolean = true,     @Json(name = "allow") val allowList: List<String> = emptyList(),     @Json(name = "deny") val denyList: List<String> = emptyList())

Class representing the EventType.STATE_ROOM_SERVER_ACL state event content Ref: https://matrix.org/docs/spec/client_server/r0.6.1#m-room-server-acl

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomStrippedState(    @Json(name = "aliases") val aliases: List<String>? = null,     @Json(name = "canonical_alias") val canonicalAlias: String? = null,     @Json(name = "name") val name: String? = null,     @Json(name = "num_joined_members") val numJoinedMembers: Int = 0,     @Json(name = "room_id") val roomId: String,     @Json(name = "topic") val topic: String? = null,     @Json(name = "world_readable") val worldReadable: Boolean = false,     @Json(name = "guest_can_join") val guestCanJoin: Boolean = false,     @Json(name = "avatar_url") val avatarUrl: String? = null,     @Json(name = "m.federate") val isFederated: Boolean = false,     @Json(name = "is_encrypted") val isEncrypted: Boolean?,     @Json(name = "room_type") val roomType: String?,     @Json(name = "membership") val membership: String?)

These are the same fields as those returned by /publicRooms, with a few additions: room_type, membership and is_encrypted.

Link copied to clipboard
data class RoomSummary(    val roomId: String,     val displayName: String = "",     val name: String = "",     val topic: String = "",     val avatarUrl: String = "",     val canonicalAlias: String? = null,     val aliases: List<String> = emptyList(),     val joinRules: RoomJoinRules? = null,     val isDirect: Boolean = false,     val directUserId: String? = null,     val directUserPresence: UserPresence? = null,     val joinedMembersCount: Int? = 0,     val invitedMembersCount: Int? = 0,     val latestPreviewableEvent: TimelineEvent? = null,     val otherMemberIds: List<String> = emptyList(),     val notificationCount: Int = 0,     val highlightCount: Int = 0,     val threadNotificationCount: Int = 0,     val threadHighlightCount: Int = 0,     val hasUnreadMessages: Boolean = false,     val tags: List<RoomTag> = emptyList(),     val membership: Membership = Membership.NONE,     val versioningState: VersioningState = VersioningState.NONE,     val readMarkerId: String? = null,     val userDrafts: List<UserDraft> = emptyList(),     val isEncrypted: Boolean,     val encryptionEventTs: Long?,     val typingUsers: List<SenderInfo>,     val inviterId: String? = null,     val breadcrumbsIndex: Int = NOT_IN_BREADCRUMBS,     val roomEncryptionTrustLevel: RoomEncryptionTrustLevel? = null,     val hasFailedSending: Boolean = false,     val roomType: String? = null,     val spaceParents: List<SpaceParentInfo>? = null,     val spaceChildren: List<SpaceChildInfo>? = null,     val directParentNames: List<String> = emptyList(),     val flattenParentIds: List<String> = emptyList(),     val roomEncryptionAlgorithm: RoomEncryptionAlgorithm? = null)

This class holds some data of a room. It can be retrieved by org.matrix.android.sdk.api.session.room.Room and org.matrix.android.sdk.api.session.room.RoomService

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomThirdPartyInviteContent(    @Json(name = "display_name") val displayName: String?,     @Json(name = "key_validity_url") val keyValidityUrl: String?,     @Json(name = "public_key") val publicKey: String?,     @Json(name = "public_keys") val publicKeys: List<PublicKeys>?)

Class representing the EventType.STATE_ROOM_THIRD_PARTY_INVITE state event content Ref: https://matrix.org/docs/spec/client_server/r0.6.1#m-room-third-party-invite

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class RoomTopicContent(@Json(name = "topic") val topic: String? = null)

Class representing the EventType.STATE_ROOM_TOPIC state event content.

Link copied to clipboard
object RoomType
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class Signed(    @Json(name = "token") val token: String,     @Json(name = "signatures") val signatures: Any,     @Json(name = "mxid") val mxid: String)
Link copied to clipboard
data class SpaceChildInfo(    val childRoomId: String,     val isKnown: Boolean,     val roomType: String?,     val name: String?,     val topic: String?,     val avatarUrl: String?,     val order: String?,     val activeMemberCount: Int?,     val viaServers: List<String>,     val parentRoomId: String?,     val suggested: Boolean?,     val canonicalAlias: String?,     val aliases: List<String>?,     val worldReadable: Boolean)
Link copied to clipboard
data class SpaceParentInfo(    val parentId: String?,     val roomSummary: RoomSummary?,     val canonical: Boolean?,     val viaServers: List<String>)
Link copied to clipboard
enum VersioningState : Enum<VersioningState>

Enum for the versioning state of a room.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class VoteInfo(    val userId: String,     val option: String,     val voteTimestamp: Long)
Link copied to clipboard
@JsonClass(generateAdapter = true)
data class VoteSummary(val total: Int = 0, val percentage: Double = 0.0)

Functions

Link copied to clipboard
fun PowerLevelsContent.banOrDefault(): Int
Link copied to clipboard
fun PowerLevelsContent.eventsDefaultOrDefault(): Int
Link copied to clipboard
fun PowerLevelsContent.inviteOrDefault(): Int
Link copied to clipboard
fun PowerLevelsContent.kickOrDefault(): Int
Link copied to clipboard
fun PowerLevelsContent.redactOrDefault(): Int
Link copied to clipboard
fun PowerLevelsContent.stateDefaultOrDefault(): Int
Link copied to clipboard
fun PowerLevelsContent.usersDefaultOrDefault(): Int