Messages

interface Messages

This interface is used to interact with messages in a chat room: subscribing to new messages, fetching history, or sending messages.

Get an instance via Room.messages.

Not suitable for inheritance

This interface is not designed for implementation or extension outside this SDK. The interface definition may evolve over time with additional properties or methods to support new features, which could break implementations.

Properties

Link copied to clipboard

Add, delete, and subscribe to message reactions.

Functions

Link copied to clipboard
Link copied to clipboard
abstract suspend fun delete(serial: String, operationDescription: String? = null, operationMetadata: Map<String, String>? = null): Message

Delete a message in the chat room.

Link copied to clipboard
suspend fun Messages.delete(message: Message, operationDescription: String? = null, operationMetadata: Map<String, String>? = null): Message

Delete a message in the chat room.

Link copied to clipboard
abstract suspend fun get(serial: String): Message

Retrieves a specific message by its serial identifier.

Link copied to clipboard
abstract suspend fun history(start: Long? = null, end: Long? = null, limit: Int = 100, orderBy: OrderBy = NewestFirst): PaginatedResult<Message>

Get messages that have been previously sent to the chat room, based on the provided options.

Link copied to clipboard
abstract suspend fun send(text: String, metadata: JsonObject? = null, headers: Map<String, String>? = null): Message

Send a message in the chat room.

Link copied to clipboard

Subscribe to new messages in this chat room.

Link copied to clipboard
abstract suspend fun update(serial: String, text: String, metadata: JsonObject? = null, headers: Map<String, String>? = null, operationDescription: String? = null, operationMetadata: Map<String, String>? = null): Message

Update a message in the chat room.

Link copied to clipboard
suspend fun Messages.update(updatedMessage: Message, operationDescription: String? = null, operationMetadata: Map<String, String>? = null): Message

Update a message in the chat room.