Message
Message envelope class.
Contains general message properties (ID, sender, timestamp, etc.) and the message content body content.
General fields (ID, sender, timestamp, etc.) are stored in Message.
Specific content (text, image, etc.) is stored in content as a MessageContent subclass.
val message: Message = ...
when (val content = message.content) {
is TextMessage -> println("Text: ${content.text}")
is ImageMessage -> println("Image: ${content.remoteUrl}")
is FileMessage -> println("File: ${content.name}")
}Parameters
Channel identifier containing channel type and channel ID
Message content body
Properties
Channel identifier containing channel type and channel ID.
Message content body.
Directed user ID list (only effective for group / community channels; null for direct channels).
Message direction (send / receive).
Whether push notification is disabled for this message.
Whether to prevent this message from updating the channel's latest message.
Whether the message has been modified (community channel messages only).
Whether this message is persisted in local storage.
Whether this is a status-only message (not stored or counted).
Message type identifier. See ai.nexconn.chat.message.model.MessageType for built-in types.
Message modification info.
Whether this message requires a read receipt.
Message received status info.
Sender user ID.
Whether a read receipt has been sent for this message.
Message sending status.
Functions
Cancels the ongoing media download for this message.
Removes message metadata by keys.
Downloads the media file attached to this message.
Channel identifier containing channel type and channel ID.
Auto-increment ID in the local database message table (client-side local ID).
Message content body.
Directed user ID list (only effective for group / community channels; null for direct channels).
Message direction (send / receive).
Whether push notification is disabled for this message.
Whether to prevent this message from updating the channel's latest message.
Whether the message has been modified (community channel messages only).
Server-side unique message ID (globally unique within the same app).
Message type identifier. See ai.nexconn.chat.message.model.MessageType for built-in types.
Message metadata in key-value format, supports remote sync.
Message modification info.
Whether this message requires a read receipt.
Message received status info.
Sender user ID.
Whether a read receipt has been sent for this message.
Message sending status.
Message sent time (Unix timestamp in milliseconds, server time).
Whether this message is persisted in local storage.
Whether this is a status-only message (not stored or counted).
Pauses the ongoing media download for this message.
Requests speech-to-text conversion for a voice message.
Requests stream message content pulling.
Message content body.
Directed user ID list (only effective for group / community channels; null for direct channels).
Message direction (send / receive).
Whether to prevent this message from updating the channel's latest message.
Message metadata in key-value format, supports remote sync.
Updates message metadata.
Message modification info.
Whether this message requires a read receipt.
Message received status info.
Sets the received status of this message.
Sender user ID.
Message sending status.
Message sent time (Unix timestamp in milliseconds, server time).
Sets the visibility of the speech-to-text result.