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
constructor(@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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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
Link copied to clipboard
Link copied to clipboard

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
Link copied to clipboard

Returns the poll question or null otherwise.

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Tells if the event is redacted.

Link copied to clipboard

Tells if the event is redacted by the user himself.

Link copied to clipboard
Link copied to clipboard

Check if event is a state event.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Determines whether or not current event has mentioned the user.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard

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
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
Link copied to clipboard
Link copied to clipboard
val stateKey: String? = null
Link copied to clipboard
Link copied to clipboard
val type: String? = null
Link copied to clipboard