aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_selector/conversation_selector_row.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-07-07 17:47:14 +0200
committerfiaxh <git@lightrise.org>2020-07-15 18:12:19 +0200
commit8e3462b1b703cb504ee397fd5a849090ee377706 (patch)
tree7150bffbab5b05102c84220a98dd21f70a4625df /main/src/ui/conversation_selector/conversation_selector_row.vala
parent932140cdd4806398f3e48be76f76abb5ab1d550b (diff)
downloaddino-8e3462b1b703cb504ee397fd5a849090ee377706.tar.gz
dino-8e3462b1b703cb504ee397fd5a849090ee377706.zip
Fix unread bubbles having wrong color on startup
Diffstat (limited to 'main/src/ui/conversation_selector/conversation_selector_row.vala')
-rw-r--r--main/src/ui/conversation_selector/conversation_selector_row.vala7
1 files changed, 4 insertions, 3 deletions
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) {