TimelineService

interface TimelineService

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

Functions

Link copied to clipboard
abstract fun createTimeline(eventId: String?, settings: TimelineSettings): Timeline

Instantiate a Timeline with an optional initial eventId, to be used with permalink. You can also configure some settings with the settings param.

Link copied to clipboard
abstract fun getAttachmentMessages(): List<TimelineEvent>

Returns a snapshot list of TimelineEvent with EventType.MESSAGE and MessageType.MSGTYPE_IMAGE or MessageType.MSGTYPE_VIDEO.

Link copied to clipboard
abstract fun getTimelineEvent(eventId: String): TimelineEvent?

Returns a snapshot of TimelineEvent event with eventId. At the opposite of getTimelineEventLive which will be updated when local echo event is synced, it will return null in this case.

Link copied to clipboard
abstract fun getTimelineEventLive(eventId: String): LiveData<Optional<TimelineEvent>>

Creates a LiveData of Optional TimelineEvent event with eventId. If the eventId is a local echo eventId, it will make the LiveData be updated with the synced TimelineEvent when coming through the sync. In this case, makes sure to use the new synced eventId from the TimelineEvent class if you want to interact, as the local echo is removed from the SDK.

Link copied to clipboard
abstract fun getTimelineEventsRelatedTo(relationType: String, eventId: String): List<TimelineEvent>

Returns a snapshot list of TimelineEvent with a content relation of the given type to the given eventId.