From 02ae72f6795317b3ecbb3bf93bb17b2ba338abc5 Mon Sep 17 00:00:00 2001 From: otsmr Date: Mon, 6 Apr 2026 00:24:17 +0200 Subject: [PATCH] improve chat list view --- .../notifications/background.notifications.dart | 1 + .../chats/chat_list_components/group_list_item.dart | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/src/services/notifications/background.notifications.dart b/lib/src/services/notifications/background.notifications.dart index c8989da..50d7820 100644 --- a/lib/src/services/notifications/background.notifications.dart +++ b/lib/src/services/notifications/background.notifications.dart @@ -209,6 +209,7 @@ Future showLocalPushNotification( (pushNotification.kind == PushKind.text || pushNotification.kind == PushKind.response || pushNotification.kind == PushKind.reactionToAudio || + pushNotification.kind == PushKind.storedMediaFile || pushNotification.kind == PushKind.reactionToImage || pushNotification.kind == PushKind.reactionToText || pushNotification.kind == PushKind.reactionToAudio)) { diff --git a/lib/src/views/chats/chat_list_components/group_list_item.dart b/lib/src/views/chats/chat_list_components/group_list_item.dart index c280222..e969e85 100644 --- a/lib/src/views/chats/chat_list_components/group_list_item.dart +++ b/lib/src/views/chats/chat_list_components/group_list_item.dart @@ -128,8 +128,14 @@ class _UserListItem extends State { } } else { // there are no not opened messages show just the last message in the table - _currentMessage = newLastMessage; - _previewMessages = [newLastMessage]; + // only shows the last message in case there was no newer messages which already got deleted + // This prevents, that it will show that a images got stored 10 days ago... + if (newLastMessage.createdAt.isAfter( + widget.group.lastMessageExchange.subtract(const Duration(minutes: 10)), + )) { + _currentMessage = newLastMessage; + _previewMessages = [newLastMessage]; + } } final msgs = _previewMessages