From af52c24df7749923df897a2dd53c367a9f8ef31f Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 26 Apr 2020 00:20:27 +0200 Subject: Fix nick change in MUC, update bookmark accordingly; remove unused code --- main/src/ui/occupant_menu/list.vala | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'main/src/ui/occupant_menu') diff --git a/main/src/ui/occupant_menu/list.vala b/main/src/ui/occupant_menu/list.vala index ffa98f31..960b716b 100644 --- a/main/src/ui/occupant_menu/list.vala +++ b/main/src/ui/occupant_menu/list.vala @@ -27,7 +27,7 @@ public class List : Box { search_entry.search_changed.connect(refilter); stream_interactor.get_module(PresenceManager.IDENTITY).show_received.connect(on_show_received); - stream_interactor.get_module(RosterManager.IDENTITY).updated_roster_item.connect(on_updated_roster_item); + stream_interactor.get_module(PresenceManager.IDENTITY).received_offline_presence.connect(on_received_offline_presence); initialize_for_conversation(conversation); } @@ -62,15 +62,18 @@ public class List : Box { rows.unset(jid); } - private void on_updated_roster_item(Account account, Jid jid, Xmpp.Roster.Item roster_item) { - + private void on_received_offline_presence(Jid jid, Account account) { + if (conversation != null && conversation.counterpart.equals_bare(jid) && jid.is_full()) { + if (rows.has_key(jid)) { + remove_occupant(jid); + } + list_box.invalidate_filter(); + } } - private void on_show_received(Show show, Jid jid, Account account) { + private void on_show_received(Jid jid, Account account) { if (conversation != null && conversation.counterpart.equals_bare(jid) && jid.is_full()) { - if (show.as == Show.OFFLINE && rows.has_key(jid)) { - remove_occupant(jid); - } else if (show.as != Show.OFFLINE && !rows.has_key(jid)) { + if (!rows.has_key(jid)) { add_occupant(jid); } list_box.invalidate_filter(); -- cgit v1.2.3-70-g09d2