ReadService

interface ReadService

This interface defines methods to handle read receipts and read marker in a room. It's implemented at the room level.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
enum MarkAsReadParams : Enum<ReadService.MarkAsReadParams>

Functions

Link copied to clipboard
abstract fun getEventReadReceiptsLive(eventId: String): LiveData<List<ReadReceipt>>

Returns a live list of read receipts for a given event.

Link copied to clipboard
abstract fun getMyReadReceiptLive(threadId: String?): LiveData<Optional<String>>

Returns a live read receipt id for the room.

Link copied to clipboard
abstract fun getReadMarkerLive(): LiveData<Optional<String>>

Returns a live read marker id for the room.

Link copied to clipboard
abstract fun getUserReadReceipt(userId: String): String?

Get the eventId from the main timeline where the read receipt for the provided user is.

Link copied to clipboard
abstract fun isEventRead(eventId: String): Boolean

Check if an event is already read, ie. your read receipt is set on a more recent event.

Link copied to clipboard
abstract suspend fun markAsRead(params: ReadService.MarkAsReadParams = MarkAsReadParams.BOTH, mainTimeLineOnly: Boolean = true)

Force the read marker to be set on the latest event.

Link copied to clipboard
abstract suspend fun setReadMarker(fullyReadEventId: String)

Set the read marker on the event with provided eventId.

Link copied to clipboard
abstract suspend fun setReadReceipt(eventId: String, threadId: String)

Set the read receipt on the event with provided eventId.