cleanHistoryMessages

public abstract void cleanHistoryMessages(ConversationType conversationType, String targetId, long recordTime, boolean cleanRemote, IRongCoreCallback.OperationCallback callback)

Deletes messages before the specified timestamp, with the option to also delete messages on the server.

This method can clear historical messages from the server, but the historical message cloud storage feature must be enabled first. Clears local database messages (server-side historical messages) before the specified timestamp for a specific conversation based on the conversation type and conversation ID. After successful deletion, only historical messages after this timestamp can be retrieved from the local database (server).

Since

5.0.0

Parameters

conversationType

The type of conversation.

targetId

The ID of the conversation.

recordTime

The timestamp before which messages will be cleared. 0 <= recordTime <= sentTime of the last message in the current conversation, 0 clears all messages, other values clear messages less than or equal to recordTime.

cleanRemote

Whether to delete messages on the server.

callback

The callback for message deletion.