updateMessage method

Future<void> updateMessage(
  1. EMMessage message
)

~english Updates a message in the local database.

The latestMessage of the conversation and other properties will be updated accordingly. The message ID of the message, however, remains the same.

Param message The message to be updated.

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

~chinese 更新 SDK 本地数据库的消息。

@note 不能更新消息 ID,消息更新后,会话的 latestMessage 等属性进行相应更新。 Param message 要更新的消息。

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

Implementation

Future<void> updateMessage(EMMessage message) async {
  Map req = this._toJson();
  req['msg'] = message.toJson();
  Map result = await _emConversationChannel.invokeMethod(
      ChatMethodKeys.updateConversationMessage, req);
  EMError.hasErrorFromResult(result);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}