From 8e3462b1b703cb504ee397fd5a849090ee377706 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 7 Jul 2020 17:47:14 +0200 Subject: Fix unread bubbles having wrong color on startup --- main/src/ui/conversation_selector/conversation_selector_row.vala | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 7ad485a3..3e0c1349 100644 --- a/main/src/ui/conversation_selector/conversation_selector_row.vala +++ b/main/src/ui/conversation_selector/conversation_selector_row.vala @@ -54,6 +54,7 @@ public class ConversationSelectorRow : ListBoxRow { stream_interactor.get_module(MucManager.IDENTITY).room_info_updated.connect((account, jid) => { if (conversation != null && conversation.counterpart.equals_bare(jid) && conversation.account.equals(account)) { update_name_label(); + update_read(true); // bubble color might have changed } }); stream_interactor.get_module(MucManager.IDENTITY).private_room_occupant_updated.connect((account, room, occupant) => { @@ -100,7 +101,7 @@ public class ConversationSelectorRow : ListBoxRow { stream_interactor.get_module(ConversationManager.IDENTITY).close_conversation(conversation); }); image.set_conversation(stream_interactor, conversation); - conversation.notify["read-up-to-item"].connect(update_read); + conversation.notify["read-up-to-item"].connect(() => update_read()); update_name_label(); content_item_received(); @@ -203,9 +204,9 @@ public class ConversationSelectorRow : ListBoxRow { } } - protected void update_read() { + protected void update_read(bool force_update = false) { int current_num_unread = stream_interactor.get_module(ChatInteraction.IDENTITY).get_num_unread(conversation); - if (num_unread == current_num_unread) return; + if (num_unread == current_num_unread && !force_update) return; num_unread = current_num_unread; if (num_unread == 0) { -- cgit v1.2.3-54-g00ecf