From 3eb9aa0fa79ea9fcebb5f702f81c2e54aafdc8cc Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 23 Apr 2017 13:50:32 +0200 Subject: Sync MUC join/part behaviour with autojoin flag in bookmarks --- main/src/ui/add_conversation/chat/roster_list.vala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'main/src/ui/add_conversation/chat') diff --git a/main/src/ui/add_conversation/chat/roster_list.vala b/main/src/ui/add_conversation/chat/roster_list.vala index c395dc3a..d09720d5 100644 --- a/main/src/ui/add_conversation/chat/roster_list.vala +++ b/main/src/ui/add_conversation/chat/roster_list.vala @@ -11,7 +11,7 @@ protected class RosterList : FilterableList { public signal void conversation_selected(Conversation? conversation); private StreamInteractor stream_interactor; - private HashMap rows = new HashMap(Jid.hash_func, Jid.equals_func); + private HashMap> rows = new HashMap>(Account.hash_func, Account.equals_func); public RosterList(StreamInteractor stream_interactor) { this.stream_interactor = stream_interactor; @@ -26,6 +26,7 @@ protected class RosterList : FilterableList { Idle.add(() => { on_updated_roster_item(account, jid, roster_item); return false;});}); foreach (Account account in stream_interactor.get_accounts()) { + rows[account] = new HashMap(Jid.hash_func, Jid.equals_func); foreach (Roster.Item roster_item in stream_interactor.get_module(RosterManager.IDENTITY).get_roster(account)) { on_updated_roster_item(account, new Jid(roster_item.jid), roster_item); } @@ -33,16 +34,16 @@ protected class RosterList : FilterableList { } private void on_removed_roster_item(Account account, Jid jid, Roster.Item roster_item) { - if (rows.has_key(jid)) { - remove(rows[jid]); - rows.unset(jid); + if (rows.has_key(account) && rows[account].has_key(jid)) { + remove(rows[account][jid]); + rows[account].unset(jid); } } private void on_updated_roster_item(Account account, Jid jid, Roster.Item roster_item) { on_removed_roster_item(account, jid, roster_item); ListRow row = new ListRow.from_jid(stream_interactor, new Jid(roster_item.jid), account); - rows[jid] = row; + rows[account][jid] = row; add(row); invalidate_sort(); invalidate_filter(); -- cgit v1.2.3-54-g00ecf