From bc086ff03429d1b73a94ac5a8be3b0350c35d9a4 Mon Sep 17 00:00:00 2001 From: Julian KOUNE Date: Wed, 13 Sep 2023 15:31:55 +0200 Subject: [PATCH] feat: change delivery status logic --- lib/pages/chat/seen_by_row.dart | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/pages/chat/seen_by_row.dart b/lib/pages/chat/seen_by_row.dart index 0db262cc29..8885c21703 100644 --- a/lib/pages/chat/seen_by_row.dart +++ b/lib/pages/chat/seen_by_row.dart @@ -5,8 +5,8 @@ import 'package:matrix/matrix.dart'; enum MessageStatus { sending, sent, - hasBeenSeenByOne, - hasBeenSeenByAll, + hasBeenSeen, + error, } class SeenByRow extends StatelessWidget { @@ -41,11 +41,11 @@ class SeenByRow extends StatelessWidget { return MessageStatus.sent; } - if (seenByUsers.length == participants.length - 1) { - return MessageStatus.hasBeenSeenByAll; + if (eventStatus == EventStatus.error) { + return MessageStatus.error; } - return MessageStatus.hasBeenSeenByOne; + return MessageStatus.hasBeenSeen; } Widget getEventIcon( @@ -66,14 +66,14 @@ class SeenByRow extends StatelessWidget { ); case MessageStatus.sent: return Icon( - Icons.done, + Icons.done_all, color: MessageTimeStyle.seenByRowIconSecondaryColor( timelineOverlayMessage, context, ), size: MessageTimeStyle.seenByRowIconSize, ); - case MessageStatus.hasBeenSeenByAll: + case MessageStatus.hasBeenSeen: return Icon( Icons.done_all, color: MessageTimeStyle.seenByRowIconPrimaryColor( @@ -82,13 +82,10 @@ class SeenByRow extends StatelessWidget { ), size: MessageTimeStyle.seenByRowIconSize, ); - case MessageStatus.hasBeenSeenByOne: + case MessageStatus.error: return Icon( - Icons.done_all, - color: MessageTimeStyle.seenByRowIconSecondaryColor( - timelineOverlayMessage, - context, - ), + Icons.error, + color: Theme.of(context).colorScheme.error, size: MessageTimeStyle.seenByRowIconSize, ); }