updateMessage abstract method

Future<void> updateMessage(
  1. Message oldMessage,
  2. Message newMessage
)

Replaces an oldMessage with a newMessage.

When implementing, the oldMessage parameter might refer to an outdated instance of the message if it has been updated elsewhere (e.g., an image message getting its dimensions). To ensure correctness:

  1. Identify the message in your data store using oldMessage.id.
  2. Retrieve the current version of that message from your store (this is the true 'before' state).
  3. The emitted ChatOperation.update(currentOldMessageFromStore, newMessage) must use this currentOldMessageFromStore and the newMessage.

Implementation

Future<void> updateMessage(Message oldMessage, Message newMessage);