summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-08-26 19:26:14 +0200
committermathieui <mathieui@mathieui.net>2016-08-26 19:26:14 +0200
commitad7b72469043ca56f35a7ce04eba35bb1edce38a (patch)
treeeae98377b228f72e2aa738a4cde4dda6de1b4daf
parentd36ecbd7b4af8e58358fffc0c637ca3ebedb08cf (diff)
downloadpoezio-ad7b72469043ca56f35a7ce04eba35bb1edce38a.tar.gz
poezio-ad7b72469043ca56f35a7ce04eba35bb1edce38a.tar.bz2
poezio-ad7b72469043ca56f35a7ce04eba35bb1edce38a.tar.xz
poezio-ad7b72469043ca56f35a7ce04eba35bb1edce38a.zip
Fix #3179 (/join completion broken)
-rw-r--r--poezio/core/completions.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/poezio/core/completions.py b/poezio/core/completions.py
index 25c23dd6..54607951 100644
--- a/poezio/core/completions.py
+++ b/poezio/core/completions.py
@@ -97,12 +97,13 @@ class CompletionCore:
relevant_rooms = []
relevant_rooms.extend(sorted(self.core.pending_invites.keys()))
- bookmarks = {str(elem.jid): False for elem in self.core.bookmarks}
- for tab in self.core.get_tabs(tabs.MucTab):
- name = tab.name
- if name in bookmarks and not tab.joined:
- bookmarks[name] = True
- relevant_rooms.extend(sorted(room[0] for room in bookmarks.items() if room[1]))
+ bookmarks = [str(elem.jid) for elem in self.core.bookmarks]
+ to_suggest = []
+ for bookmark in bookmarks:
+ tab = self.core.get_tab_by_name(bookmark, tabs.MucTab)
+ if not tab or (tab and not tab.joined):
+ to_suggest.append(bookmark)
+ relevant_rooms.extend(sorted(to_suggest))
if the_input.last_completion:
return Completion(the_input.new_completion, [], 1, quotify=True)