react method

Future<void> react(
  1. Message msg,
  2. String? react, {
  3. ChatSilentNotification? notification,
})

Implementation

Future<void> react(
  Message msg,
  String? react, {
  ChatSilentNotification? notification,
}) async {
  if (msg.isSending) return;
  put(msg.copyWith(react: react));
  final status = await RoomManager.i.updateMessage(
    msg.roomId,
    msg.id,
    {
      '${MessageKeys.i.reactions}.$me':
          (react ?? '').isEmpty ? ChatValueDelete() : react,
    },
    notification: notification ?? const ChatSilentNotification(),
  );
  if (!status) put(msg);
}