From 1287135ebbe8420de44ab73ce6a553b17067dfdb Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 14 Sep 2019 16:08:08 +0200 Subject: Improve conversation unread status detection --- main/src/ui/conversation_selector/conversation_selector_row.vala | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'main/src/ui/conversation_selector/conversation_selector_row.vala') diff --git a/main/src/ui/conversation_selector/conversation_selector_row.vala b/main/src/ui/conversation_selector/conversation_selector_row.vala index 8d601309..3696f6da 100644 --- a/main/src/ui/conversation_selector/conversation_selector_row.vala +++ b/main/src/ui/conversation_selector/conversation_selector_row.vala @@ -166,13 +166,10 @@ public class ConversationSelectorRow : ListBoxRow { } protected void update_read() { - MessageItem? message_item = last_content_item as MessageItem; - if (message_item == null) return; - Message last_message = message_item.message; + bool current_read_status = !stream_interactor.get_module(ChatInteraction.IDENTITY).has_unread(conversation); + if (read == current_read_status) return; + read = current_read_status; - bool read_was = read; - read = last_message == null || (conversation.read_up_to != null && last_message.equals(conversation.read_up_to)); - if (read == read_was) return; if (read) { name_label.attributes.filter((attr) => attr.equal(attr_weight_new(Weight.BOLD))); time_label.attributes.filter((attr) => attr.equal(attr_weight_new(Weight.BOLD))); -- cgit v1.2.3-54-g00ecf