cleanHistoryMessages

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

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

This method can clear historical messages from the server, but the historical message cloud storage feature must be enabled first. It clears messages before the specified timestamp in the local database (or server-side historical messages) based on the conversation type and conversation ID. After successful clearance, only historical messages after the specified timestamp can be retrieved from the local database (or server).

Parameters

conversationType

Specifies the conversation type.

targetId

Specifies the conversation ID.

recordTime

The timestamp before which messages will be deleted. 0 <= recordTime <= the sentTime of the last message in the current conversation. A value of 0 deletes all messages, while other values delete messages less than or equal to the recordTime.

cleanRemote

Indicates whether to delete messages on the server.

callback

The callback for the message deletion operation.