diff options
author | fiaxh <git@mx.ax.lt> | 2017-09-19 23:23:12 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-09-19 23:39:17 +0200 |
commit | 7430efee5714232e1a0a704526098e58a9dc9352 (patch) | |
tree | 8f92e3e7185f07fc73e69aac3f1cfaa143a412b8 /main/src/ui/conversation_selector/conversation_row.vala | |
parent | 8fdb38b99be9c588148d576c23212af765ff7302 (diff) | |
download | dino-7430efee5714232e1a0a704526098e58a9dc9352.tar.gz dino-7430efee5714232e1a0a704526098e58a9dc9352.zip |
Change conversation (un)read marking
Diffstat (limited to 'main/src/ui/conversation_selector/conversation_row.vala')
-rw-r--r-- | main/src/ui/conversation_selector/conversation_row.vala | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/main/src/ui/conversation_selector/conversation_row.vala b/main/src/ui/conversation_selector/conversation_row.vala index da9dbf68..a838124d 100644 --- a/main/src/ui/conversation_selector/conversation_row.vala +++ b/main/src/ui/conversation_selector/conversation_row.vala @@ -57,14 +57,7 @@ public abstract class ConversationRow : ListBoxRow { last_message = stream_interactor.get_module(MessageStorage.IDENTITY).get_last_message(conversation) ?? m; update_message_label(); update_time_label(); - } - - public void mark_read() { - update_read(true); - } - - public void mark_unread() { - update_read(false); + update_read(); } public virtual void on_show_received(Show presence) { @@ -103,8 +96,10 @@ public abstract class ConversationRow : ListBoxRow { } } - protected void update_read(bool read) { - this.read = read; + protected void update_read() { + 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))); |