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/occupant_menu | |
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/occupant_menu')
-rw-r--r-- | main/src/ui/occupant_menu/list.vala | 17 |
1 files changed, 10 insertions, 7 deletions
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(); |