deleteRemoteMessagesWithIds method

Future<void> deleteRemoteMessagesWithIds({
  1. required String conversationId,
  2. required EMConversationType type,
  3. required List<String> msgIds,
})

~english Unidirectionally removes historical message by message ID from the server.

Param conversationId The conversation ID.

Param type The conversation type.

Param msgIds The list of IDs of messages to be removed. ~end

~chinese 根据消息ID 单向删除服务器会话中的消息和本地消息。

Param conversationId 会话 ID。

Param type 会话类型。

Param msgIds 需要删除的消息 ID。 ~end

Implementation

Future<void> deleteRemoteMessagesWithIds(
    {required String conversationId,
    required EMConversationType type,
    required List<String> msgIds}) async {
  Map request = {
    "convId": conversationId,
    "type": type.index,
    "msgIds": msgIds,
  };
  Map result = await ChatChannel.invokeMethod(
    ChatMethodKeys.removeMessagesFromServerWithMsgIds,
    request,
  );
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}