deleteMessage method

Future<void> deleteMessage(
  1. String messageId
)

~english Deletes a message in the local database.

Note After this method is called, the message is only deleted both from the memory and the local database.

Param messageId The ID of message to be deleted.

Throws A description of the exception. See ChatError. ~end

~chinese 删除会话中的一条消息,同时清除内存和数据库中的消息。

Param messageId 要删除的消息。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError。 ~end

Implementation

Future<void> deleteMessage(String messageId) async {
  Map req = this._toJson();
  req['msg_id'] = messageId;
  Map result = await _emConversationChannel.invokeMethod(
      ChatMethodKeys.removeMessage, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}