From 9e8b99e86c5f91b6a981c17580855adc68df921a Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 3 Jan 2022 18:33:22 +0100 Subject: Fix runtime critical on incoming read marker This would result in all messages being counted as unread and highlighted in the conversation list accordingly. As of fa1ba2f8, there are no hidden content items for http file upload _messages_ anymore. --- libdino/src/service/counterpart_interaction_manager.vala | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libdino') diff --git a/libdino/src/service/counterpart_interaction_manager.vala b/libdino/src/service/counterpart_interaction_manager.vala index 03eb6c6f..cc5489c3 100644 --- a/libdino/src/service/counterpart_interaction_manager.vala +++ b/libdino/src/service/counterpart_interaction_manager.vala @@ -153,7 +153,9 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object { if (conversation.read_up_to != null && conversation.read_up_to.local_time.compare(message.local_time) > 0) return; conversation.read_up_to = message; + // TODO: This only marks messages as read, not http file transfers. ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item(conversation, 1, message.id); + if (content_item == null) return; ContentItem? read_up_to_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item_by_id(conversation, conversation.read_up_to_item); if (read_up_to_item != null && read_up_to_item.compare(content_item) > 0) return; conversation.read_up_to_item = content_item.id; -- cgit v1.2.3-70-g09d2