TimelineEvent

data class TimelineEvent(    val root: Event,     val localId: Long,     val eventId: String,     val displayIndex: Int,     val ownedByThreadChunk: Boolean = false,     val senderInfo: SenderInfo,     val annotations: EventAnnotationsSummary? = null,     val readReceipts: List<ReadReceipt> = emptyList())

This data class is a wrapper around an Event. It allows to get useful data in the context of a timeline. This class is used by TimelineService Users can also enrich it with metadata.

Constructors

Link copied to clipboard
fun TimelineEvent(    root: Event,     localId: Long,     eventId: String,     displayIndex: Int,     ownedByThreadChunk: Boolean = false,     senderInfo: SenderInfo,     annotations: EventAnnotationsSummary? = null,     readReceipts: List<ReadReceipt> = emptyList())

Functions

Link copied to clipboard
fun enrichWith(key: String?, data: Any?)

The method to enrich this timeline event. If you provides multiple data with the same key, only first one will be kept.

Link copied to clipboard
inline fun <T> getMetadata(key: String): T?

Get the metadata associated with a key.

Link copied to clipboard
fun isEncrypted(): Boolean

Properties

Link copied to clipboard
val annotations: EventAnnotationsSummary? = null
Link copied to clipboard
val displayIndex: Int

This display index is the position in the current chunk. It's not unique on the timeline as it's reset on each chunk.

Link copied to clipboard
val eventId: String
Link copied to clipboard
val localId: Long

Uniquely identify an event, computed locally by the sdk.

Link copied to clipboard
val metadata: HashMap<String, Any>
Link copied to clipboard
val ownedByThreadChunk: Boolean = false
Link copied to clipboard
val readReceipts: List<ReadReceipt>
Link copied to clipboard
val roomId: String
Link copied to clipboard
val root: Event
Link copied to clipboard
val senderInfo: SenderInfo

Extensions

Link copied to clipboard
fun TimelineEvent.getEditedEventId(): String?

Get the eventId which was edited by this event if any.

Link copied to clipboard
fun TimelineEvent.getLastEditNewContent(): Content?
Link copied to clipboard
fun TimelineEvent.getLastMessageContent(): MessageContent?

Get last MessageContent, after a possible edition.

Link copied to clipboard
fun TimelineEvent.getLatestEventId(): String

Get the latest known eventId for an edited event, or the eventId for an Event which has not been edited.

Link copied to clipboard
fun TimelineEvent.getRelationContent(): RelationDefaultContent?

Get the relation content if any.

Link copied to clipboard
fun TimelineEvent.getTextEditableContent(formatted: Boolean): String

Get the latest message body, after a possible edition, stripping the reply prefix if necessary.

Link copied to clipboard
fun TimelineEvent.hasBeenEdited(): Boolean

Tells if the event has been edited.

Link copied to clipboard
fun TimelineEvent.isEdition(): Boolean
Link copied to clipboard
fun TimelineEvent.isLiveLocation(): Boolean
Link copied to clipboard
fun TimelineEvent.isPoll(): Boolean
Link copied to clipboard
fun TimelineEvent.isReply(): Boolean

Returns true if it's a reply.

Link copied to clipboard
fun TimelineEvent.isRootThread(): Boolean

Returns whether or not the event is a root thread event.

Link copied to clipboard
fun TimelineEvent.isSticker(): Boolean