deleteLocalAndServerMessages method

Future<void> deleteLocalAndServerMessages({
  1. required List<String> msgIds,
})

Removes local and server messages from the conversation by message ID.

Param msgIds The message ids.

Throws A description of the exception. See ChatError.

Implementation

Future<void> deleteLocalAndServerMessages(
    {required List<String> msgIds}) async {
  try {
    Map req = _toJson();
    req.putIfNotNull("msgIds", msgIds);
    Map result = await platform_interface.Client.instance.conversationManager.callNativeMethod(
        ChatMethodKeys.conversationDeleteServerMessageWithIds, req);
    ChatError.hasErrorFromResult(result);
    return result[ChatMethodKeys.conversationGetLocalMessageCount];
  } catch (e) {
    rethrow;
  }
}