diff options
author | fiaxh <git@lightrise.org> | 2020-04-26 00:20:27 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-04-26 00:20:27 +0200 |
commit | af52c24df7749923df897a2dd53c367a9f8ef31f (patch) | |
tree | de9bbeef864cc90b84bd9498c28240fc308ee319 /main/src/ui/conversation_selector | |
parent | ee9795d8f466706e06b2fdbc9beca2f8ecbf5d08 (diff) | |
download | dino-af52c24df7749923df897a2dd53c367a9f8ef31f.tar.gz dino-af52c24df7749923df897a2dd53c367a9f8ef31f.zip |
Fix nick change in MUC, update bookmark accordingly; remove unused code
Diffstat (limited to 'main/src/ui/conversation_selector')
-rw-r--r-- | main/src/ui/conversation_selector/conversation_selector_row.vala | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/main/src/ui/conversation_selector/conversation_selector_row.vala b/main/src/ui/conversation_selector/conversation_selector_row.vala index 467bed70..09de3c80 100644 --- a/main/src/ui/conversation_selector/conversation_selector_row.vala +++ b/main/src/ui/conversation_selector/conversation_selector_row.vala @@ -250,7 +250,8 @@ public class ConversationSelectorRow : ListBoxRow { for (int i = 0; i < full_jids.size; i++) { Jid full_jid = full_jids[i]; - Show show = stream_interactor.get_module(PresenceManager.IDENTITY).get_last_show(full_jid, conversation.account); + string? show = stream_interactor.get_module(PresenceManager.IDENTITY).get_last_show(full_jid, conversation.account); + if (show == null) continue; Xep.ServiceDiscovery.Identity? identity = stream_interactor.get_module(EntityInfo.IDENTITY).get_identity(conversation.account, full_jid); Image image = new Image() { hexpand=false, valign=Align.START, visible=true }; @@ -260,20 +261,20 @@ public class ConversationSelectorRow : ListBoxRow { image.set_from_icon_name("dino-device-desktop-symbolic", IconSize.SMALL_TOOLBAR); } - if (show.as == Show.AWAY) { + if (show == Presence.Stanza.SHOW_AWAY) { Util.force_color(image, "#FF9800"); - } else if (show.as == Show.XA || show.as == Show.DND) { + } else if (show == Presence.Stanza.SHOW_XA || show == Presence.Stanza.SHOW_DND) { Util.force_color(image, "#FF5722"); } else { Util.force_color(image, "#4CAF50"); } string? status = null; - if (show.as == Show.AWAY) { + if (show == Presence.Stanza.SHOW_AWAY) { status = "away"; - } else if (show.as == Show.XA) { + } else if (show == Presence.Stanza.SHOW_XA) { status = "not available"; - } else if (show.as == Show.DND) { + } else if (show == Presence.Stanza.SHOW_DND) { status = "do not disturb"; } @@ -288,9 +289,7 @@ public class ConversationSelectorRow : ListBoxRow { continue; } if (status != null) { - sb.append(" <i>("); - sb.append(status); - sb.append(")</i>"); + sb.append(" <i>(").append(status).append(")</i>"); } Label resource = new Label(sb.str) { use_markup=true, hexpand=true, xalign=0, visible=true }; |