batchInsertMessage

public abstract void batchInsertMessage(List<Message> messages, IRongCoreCallback.ResultCallback<Boolean> callback)

Batch inserts received messages (these messages are only inserted into the local database and are not actually sent to the server or the other party). The following attributes of the Message will be stored in the database, while other attributes will be discarded: - conversationType: Conversation type - targetId: Conversation ID - messageDirection: Message direction - senderUserId: Sender ID - receivedStatus: Receipt status; if the message direction is inbound and message.getReceivedStatus().setRead() has not been called, the message is unread. - sentStatus: Sending status - content: Message content - sentTime: Message sending time (Unix timestamp in milliseconds, which affects message sorting) - extra: Additional fields of the Message

This method does not support chatroom conversation types. Each batch can process up to 500 messages. If the batch exceeds 500 messages, it will return RC_INVALID_PARAMETER_MESSAGE_LIST. The unread count of the messages will be accumulated to the conversation's unread count.

Since

5.1.1

Parameters

messages

List of messages to be processed in batch

callback

Callback


public abstract void batchInsertMessage(List<Message> messages, boolean enableCheck, IRongCoreCallback.ResultCallback<Boolean> callback)

Batch inserts received messages (these messages are only inserted into the local database and will not be sent to the server or the other party). The following attributes of the Message will be stored in the database, while other attributes will be discarded: - conversationType: Conversation type - targetId: Conversation ID - UId: Unique message ID - messageDirection: Message direction - senderUserId: Sender ID - receivedStatus: Receipt status; if the message direction is incoming and message.getReceivedStatus().setRead() has not been called, the message is unread. - sentStatus: Sending status - content: Message content - sentTime: Message sending time (Unix timestamp in milliseconds, which affects message sorting) - extra: Additional fields of the Message

This method does not support chatroom conversation types. Each batch can process up to 500 messages. If the batch exceeds 500 messages, it will return RC_INVALID_PARAMETER_MESSAGE_LIST. The unread count of messages will be accumulated into the unread count of the conversation.

Since

5.3.5

Parameters

messages

List of messages to be processed in batch

enableCheck

Whether message deduplication is required

callback

Callback