From 71be2abb6a007fd9b4ed3164d70f5cb95d49ce69 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 29 Apr 2020 21:31:23 +0200 Subject: Store last read content item for conversations fixes #495 --- libdino/src/service/notification_events.vala | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'libdino/src/service/notification_events.vala') diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala index 3f4e3c6d..5e81ff89 100644 --- a/libdino/src/service/notification_events.vala +++ b/libdino/src/service/notification_events.vala @@ -33,15 +33,9 @@ public class NotificationEvents : StreamInteractionModule, Object { } private void on_content_item_received(ContentItem item, Conversation conversation) { - ContentItem last_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_latest(conversation); - bool not_read_up_to = true; - MessageItem message_item = item as MessageItem; - if (message_item != null) { - not_read_up_to = conversation.read_up_to != null && !conversation.read_up_to.equals(message_item.message); - } - if (item.id != last_item.id && not_read_up_to) return; + if (item.id != last_item.id && last_item.id != conversation.read_up_to_item) return; if (!should_notify(item, conversation)) return; if (stream_interactor.get_module(ChatInteraction.IDENTITY).is_active_focus()) return; -- cgit v1.2.3-54-g00ecf