updateMessage method
- ChatMessage 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 ChatError. ~end
~chinese 更新 SDK 本地数据库的消息。
@note
不能更新消息 ID,消息更新后,会话的 latestMessage
等属性进行相应更新。
Param message
要更新的消息。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError。 ~end
Implementation
Future<void> updateMessage(ChatMessage message) async {
Map req = this._toJson();
req['msg'] = message.toJson();
Map result = await _emConversationChannel.invokeMethod(
ChatMethodKeys.updateConversationMessage, req);
ChatError.hasErrorFromResult(result);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}