updateMessage method

Future<void> updateMessage({
  1. required Message message,
  2. bool runMessageUpdate = false,
  3. bool needUpdateConversationList = false,
})

Implementation

Future<void> updateMessage({
  required Message message,
  bool runMessageUpdate = false,
  bool needUpdateConversationList = false,
}) {
  return checkResult(ChatSDKEvent.updateMessage, () async {
    final oldMsg =
        await Client.getInstance.chatManager.loadMessage(message.msgId);
    await Client.getInstance.chatManager.updateMessage(message);

    if (runMessageUpdate) {
      super.onMessageUpdate(message, oldMsg);
    }

    if (needUpdateConversationList) {
      super.onConversationsUpdate();
    }
  });
}