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

Types

Link copied to clipboard
data class EventTypeFilter(val eventType: String, val stateKey: String?)
Link copied to clipboard
interface Timeline

A Timeline instance represents a contiguous sequence of events in a room.

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

Link copied to clipboard
data class TimelineEventFilters(    val filterEdits: Boolean = false,     val filterRedacted: Boolean = false,     val filterUseless: Boolean = false,     val filterTypes: Boolean = false,     val allowedTypes: List<EventTypeFilter> = emptyList())
Link copied to clipboard
interface TimelineService

This interface defines methods to interact with the timeline. It's implemented at the room level.

Link copied to clipboard
data class TimelineSettings(    val initialSize: Int,     val buildReadReceipts: Boolean = true,     val rootThreadEventId: String? = null,     val useLiveSenderInfo: Boolean = false)

Data class holding setting values for a Timeline instance.

Functions

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 MessageContent.getTextDisplayableContent(): String

Get the latest displayable content. Will take care to hide spoiler text

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