setLocalClearedAt method

  1. @override
Future<ChatResult<void>> setLocalClearedAt(
  1. String roomId,
  2. DateTime clearedAt
)
override

Pure-local counterpart to clearChat: sets the clear-chat cutoff without also calling markRoomAsRead server-side. Used by ChatRoomsController.delete (WhatsApp "Delete chat"), which — unlike clearChat — must stay purely local and never fail on account of connectivity (deleting a chat has no server-side counterpart at all). No-op (never throws) when no local datasource is configured.

Implementation

@override
Future<ChatResult<void>> setLocalClearedAt(
  String roomId,
  DateTime clearedAt,
) async {
  _clearedAt[roomId] = clearedAt;
  return const ChatSuccess(null);
}