The conversation ID.
The conversation type.
The conversation extension.
Whether the current conversation is a thread conversation.
true
: Yes.false
: No.Note
This parameter is valid only for group chat.
Whether the conversation is pinned:
true
: Yes.false
: No.The UNIX timestamp when the conversation is pinned. The unit is millisecond. This value is 0
when the conversation is not pinned.
Deletes all the messages of the conversation.
This method deletes all the messages of the conversation from both the memory and local database.
Deletes a message from the local database.
The ID of message to delete.
Deletes messages sent or received in a certain period from the local database.
Uses the pagination to get messages in the specified conversation from the server.
The list of retrieved messages (excluding the one with the starting ID) and the cursor for the next query.
retrieve the history message for the specified session from the server.
The list of retrieved messages (excluding the one with the starting ID) and the cursor for the next query.
Gets the latest message from the conversation.
The message instance. The SDK returns undefined
if the message does not exist.
Gets the latest message received in the conversation.
The message instance. The SDK returns undefined
if the message does not exist.
Gets messages that are sent and received in a certain period in a conversation in the local database.
The starting Unix timestamp for search. The unit is millisecond.
The ending Unix timestamp for search. The unit is millisecond.
The message search direction. See ChatSearchDirection.
ChatSearchDirection.UP
: Messages are retrieved in the descending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.ChatSearchDirection.DOWN
: Messages are retrieved in the ascending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.The maximum number of messages to retrieve each time. The value range is [1,400].
The list of retrieved messages (excluding the ones with the starting or ending timestamp). If no message is obtained, an empty list is returned.
Retrieves messages of a certain quantity in a conversation from the local database.
Note
The obtained messages will also join the existing messages of the conversation stored in the memory.
The starting message ID for query. After this parameter is set, the SDK retrieves messages, starting from the specified one, according to the message search direction.
If this parameter is set an empty string, the SDK retrieves messages according to the message search direction while ignoring this parameter.
- If direction
is set as ChatSearchDirection.UP
, the SDK retrieves messages, starting from the latest one, in the descending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.
- If direction
is set as ChatSearchDirection.DOWN
, the SDK retrieves messages, starting from the oldest one, in the ascending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.
The message search direction. See ChatSearchDirection.
ChatSearchDirection.UP
: Messages are retrieved in the descending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.ChatSearchDirection.DOWN
: Messages are retrieved in the ascending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.The maximum number of messages to retrieve each time. The value range is [1,400].
The message list (excluding the ones with the starting or ending timestamp). If no message is obtained, an empty list is returned.
Retrieves messages with keywords in a conversation in the local database.
The keywords for query.
The message search direction. See ChatSearchDirection.
ChatSearchDirection.Up
: Messages are retrieved in the descending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.ChatSearchDirection.Down
: Messages are retrieved in the ascending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.The starting Unix timestamp in the message for query. The unit is millisecond. After this parameter is set, the SDK retrieves messages, starting from the specified one, according to the message search direction. If you set this parameter as a negative value, the SDK retrieves messages, starting from the current time, in the descending order of the the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.
The maximum number of messages to retrieve each time. The value range is [1,400].
The user ID or group ID for retrieval. Usually, it is the conversation ID.
The list of retrieved messages (excluding the one with the starting timestamp). If no message is obtained, an empty list is returned.
Retrieves messages of a certain type that a specified user sends in a conversation.
The message type. See ChatMessageType.
The message search direction. See ChatSearchDirection.
ChatSearchDirection.UP
: Messages are retrieved in the descending order of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.ChatSearchDirection.DOWN
: Messages are retrieved in the ascending of the Unix timestamp (ChatOptions.sortMessageByServerTime) included in them.The starting Unix timestamp in the message for query. The unit is millisecond. After this parameter is set, the SDK retrieves messages, starting from the specified one, according to the message search direction. If you set this parameter as a negative value, the SDK retrieves messages, starting from the current time, in the descending order of the timestamp included in them.
The maximum number of messages to retrieve each time. The value range is [1,400].
The user ID or group ID for retrieval. Usually, it is the conversation ID.
The list of retrieved messages (excluding the one with the starting timestamp). If no message is obtained, an empty list is returned.
Gets the count of unread messages in the conversation.
The count of unread messages.
Marks all messages as read.
Marks a message as read.
The message ID.
Gets the conversation ID.
The conversation ID.
Deletes messages from the conversation (from both local storage and server).
The IDs of messages to delete from the current conversation.
Deletes messages from the conversation (from both local storage and server).
The message timestamp in millisecond. The messages with the timestamp smaller than the specified one will be deleted.
Sets the extension information of the conversation.
The extension information of the conversation. This parameter must be in the key-value format.
Updates a message in the local database.
After you modify a message, the message ID remains unchanged and the SDK automatically updates attributes of the conversation, like latestMessage
.
The message instance.
Generated using TypeDoc
export class type