diff options
author | fiaxh <git@lightrise.org> | 2019-09-14 16:08:08 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2019-09-29 00:47:22 +0200 |
commit | 1287135ebbe8420de44ab73ce6a553b17067dfdb (patch) | |
tree | 10af5c66b8f920c07122270b0374b862222b8bc4 /main | |
parent | f746ce74ce6e905483d86b603df01b81acbca7b4 (diff) | |
download | dino-1287135ebbe8420de44ab73ce6a553b17067dfdb.tar.gz dino-1287135ebbe8420de44ab73ce6a553b17067dfdb.zip |
Improve conversation unread status detection
Diffstat (limited to 'main')
-rw-r--r-- | main/src/ui/conversation_selector/conversation_selector_row.vala | 9 |
1 files changed, 3 insertions, 6 deletions
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))); |