partialUpdateMessage method

Future<UpdateMessageResponse> partialUpdateMessage(
  1. Message message, {
  2. Map<String, Object?>? set,
  3. List<String>? unset,
})

Partially updates the message in this channel.

Use set to define values to be set.

Use unset to define values to be unset.

Implementation

Future<UpdateMessageResponse> partialUpdateMessage(
  Message message, {
  Map<String, Object?>? set,
  List<String>? unset,
}) async {
  try {
    final response = await _client.partialUpdateMessage(
      message.id,
      set: set,
      unset: unset,
    );

    final updatedMessage = response.message.copyWith(
      ownReactions: message.ownReactions,
    );

    state?.updateMessage(updatedMessage);

    return response;
  } catch (e) {
    if (e is StreamChatNetworkError && e.isRetriable) {
      state!._retryQueue.add([message]);
    }
    rethrow;
  }
}