clearMessages

public abstract void clearMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)

Deletes all messages in a specified conversation.

Note: Chatrooms are not supported!

Since

5.1.1

Parameters

conversationType

The type of conversation. Chatrooms are not supported. Refer to Conversation.ConversationType.

targetId

The ID of the conversation. Depending on the conversationType, it could be a user ID, discussion group ID, or group ID.

channelId

The business identifier of the conversation to which the messages belong.

callback

Callback indicating whether the operation was successful.


public abstract void clearMessages(List<ClearMessageOption> clearMessageOptions, IRongCoreCallback.ResultCallback<Boolean> callback)

Asynchronously deletes all local database messages in the specified conversations that were sent on or before the given timestamp.

This method removes message records in the database for conversations that were sent on or before the specified timestamp. A timestamp of 0 clears all messages.

Supported conversation types: one-to-one chat, group chat, chatroom, system message.

Since

5.6.7

Parameters

clearMessageOptions

The list of message deletion parameters, with a maximum of 20 entries.

callback

Callback indicating whether the deletion was successful.