deleteLocalAndServerMessages method
~english
Removes local and server messages from the conversation by message ID.
Param msgIds
The message ids.
Throws A description of the exception. See EMError. ~end
~chinese
通过消息 ID 从本地和服务器删除消息。
Param msgIds
消息 ID。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError。
~end
Implementation
Future<void> deleteLocalAndServerMessages(
{required List<String> msgIds}) async {
Map req = _toJson();
req.putIfNotNull("msgIds", msgIds);
Map result = await _emConversationChannel.invokeMethod(
ChatMethodKeys.conversationDeleteServerMessageWithIds, req);
try {
EMError.hasErrorFromResult(result);
return result[ChatMethodKeys.conversationGetLocalMessageCount];
} catch (e) {
rethrow;
}
}