Event

@JsonClass(generateAdapter = true)
data class Event(    @Json(name = "type") val type: String? = null,     @Json(name = "event_id") val eventId: String? = null,     @Json(name = "content") val content: Content? = null,     @Json(name = "prev_content") val prevContent: Content? = null,     @Json(name = "origin_server_ts") val originServerTs: Long? = null,     @Json(name = "sender") val senderId: String? = null,     @Json(name = "state_key") val stateKey: String? = null,     @Json(name = "room_id") val roomId: String? = null,     @Json(name = "unsigned") val unsignedData: UnsignedData? = null,     @Json(name = "redacts") val redacts: String? = null)

Generic event class with all possible fields for events. The content and prevContent json fields can easily be mapped to a model with toModel method.

Constructors

Link copied to clipboard
fun Event(    @Json(name = "type") type: String? = null,     @Json(name = "event_id") eventId: String? = null,     @Json(name = "content") content: Content? = null,     @Json(name = "prev_content") prevContent: Content? = null,     @Json(name = "origin_server_ts") originServerTs: Long? = null,     @Json(name = "sender") senderId: String? = null,     @Json(name = "state_key") stateKey: String? = null,     @Json(name = "room_id") roomId: String? = null,     @Json(name = "unsigned") unsignedData: UnsignedData? = null,     @Json(name = "redacts") redacts: String? = null)

Functions

Link copied to clipboard
fun copyAll(    type: String? = this.type,     eventId: String? = this.eventId,     content: Content? = this.content,     prevContent: Content? = this.prevContent,     originServerTs: Long? = this.originServerTs,     senderId: String? = this.senderId,     stateKey: String? = this.stateKey,     roomId: String? = this.roomId,     unsignedData: UnsignedData? = this.unsignedData,     redacts: String? = this.redacts,     mxDecryptionResult: OlmDecryptionResult? = this.mxDecryptionResult,     verificationStateIsDirty: Boolean? = this.verificationStateIsDirty,     mCryptoError: MXCryptoError.ErrorType? = this.mCryptoError,     mCryptoErrorReason: String? = this.mCryptoErrorReason,     sendState: SendState = this.sendState,     ageLocalTs: Long? = this.ageLocalTs,     threadDetails: ThreadDetails? = this.threadDetails): Event

Copy all fields, including transient fields.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun getClearContent(): Content?
Link copied to clipboard
fun getClearType(): String
Link copied to clipboard
fun getDecryptedContent(): Content?
Link copied to clipboard
fun getDecryptedTextSummary(): String?

Returns a user friendly content depending on the message type. It can be used especially for message summaries. It will return a decrypted text message or an empty string otherwise.

Link copied to clipboard
fun getDecryptedType(): String?
Link copied to clipboard
fun getKeysClaimed(): Map<String, String>
Link copied to clipboard
fun getSenderKey(): String?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isEncrypted(): Boolean
Link copied to clipboard
fun isRedacted(): Boolean

Tells if the event is redacted.

Link copied to clipboard
fun isRedactedBySameUser(): Boolean

Tells if the event is redacted by the user himself.

Link copied to clipboard
fun isStateEvent(): Boolean

Check if event is a state event.

Link copied to clipboard
fun isUserMentioned(userId: String): Boolean

Determines whether or not current event has mentioned the user.

Link copied to clipboard
fun resolvedPrevContent(): Content?
Link copied to clipboard
fun sendStateError(): MatrixError?
Link copied to clipboard
fun toClearContentStringWithIndent(): String?
Link copied to clipboard
fun toContentStringWithIndent(): String

Properties

Link copied to clipboard
var ageLocalTs: Long? = null

The age value transcoded in a timestamp based on the device clock when the SDK received the event from the homeserver. Unlike age, this value is static.

Link copied to clipboard
val content: Content? = null
Link copied to clipboard
val eventId: String? = null
Link copied to clipboard
var mCryptoError: MXCryptoError.ErrorType? = null
Link copied to clipboard
var mCryptoErrorReason: String? = null
Link copied to clipboard
var mxDecryptionResult: OlmDecryptionResult? = null
Link copied to clipboard
val originServerTs: Long? = null
Link copied to clipboard
val prevContent: Content? = null
Link copied to clipboard
val redacts: String? = null
Link copied to clipboard
val roomId: String? = null
Link copied to clipboard
val senderId: String? = null
Link copied to clipboard
var sendState: SendState
Link copied to clipboard
var sendStateDetails: String? = null
Link copied to clipboard
val stateKey: String? = null
Link copied to clipboard
var threadDetails: ThreadDetails? = null
Link copied to clipboard
val type: String? = null
Link copied to clipboard
val unsignedData: UnsignedData? = null
Link copied to clipboard
var verificationStateIsDirty: Boolean? = null

Extensions

Link copied to clipboard
fun Event.asMessageAudioEvent(): MessageAudioEvent?
Link copied to clipboard
fun Event.getMsgType(): String?

Return the value of "content.msgtype", if the Event type is "m.room.message" and if the content has it, and if it is a String.

Link copied to clipboard
fun Event.getPollContent(): MessagePollContent?
Link copied to clipboard
fun Event.getPollQuestion(): String?

Returns the poll question or null otherwise.

Link copied to clipboard
fun Event.getRelationContent(): RelationDefaultContent?
Link copied to clipboard
fun Event.getRelationContentForType(type: String): RelationDefaultContent?

Returns the relation content for a specific type or null otherwise.

Link copied to clipboard
fun Event.getRootThreadEventId(): String?
Link copied to clipboard
fun Event.isAttachmentMessage(): Boolean
Link copied to clipboard
fun Event.isAudioMessage(): Boolean
Link copied to clipboard
fun Event.isContentReportable(): Boolean
Link copied to clipboard
fun Event.isEdition(): Boolean
Link copied to clipboard
fun Event.isFileMessage(): Boolean
Link copied to clipboard
fun Event.isImageMessage(): Boolean
Link copied to clipboard
fun Event.isInvitation(): Boolean
Link copied to clipboard
fun Event.isLiveLocation(): Boolean
Link copied to clipboard
fun Event.isLocationMessage(): Boolean
Link copied to clipboard
fun Event.isPoll(): Boolean
Link copied to clipboard
fun Event.isPollEnd(): Boolean
Link copied to clipboard
fun Event.isPollResponse(): Boolean
Link copied to clipboard
fun Event.isPollStart(): Boolean
Link copied to clipboard
fun Event.isReply(): Boolean
Link copied to clipboard
fun Event.isReplyRenderedInThread(): Boolean
Link copied to clipboard
fun Event.isSticker(): Boolean
Link copied to clipboard
fun Event.isTextMessage(): Boolean
Link copied to clipboard
fun Event.isThread(): Boolean
Link copied to clipboard
fun Event.isVideoMessage(): Boolean
Link copied to clipboard
fun Event.isVoiceMessage(): Boolean
Link copied to clipboard
fun Event.supportsNotification(): Boolean
Link copied to clipboard
fun Event.toDeviceTracingId(): String?
Link copied to clipboard
fun Event.toValidDecryptedEvent(): ValidDecryptedEvent?