Fix #3179 (/join completion broken)

This commit is contained in:
mathieui 2016-08-26 19:26:14 +02:00
parent d36ecbd7b4
commit ad7b724690

View file

@ -97,12 +97,13 @@ class CompletionCore:
relevant_rooms = [] relevant_rooms = []
relevant_rooms.extend(sorted(self.core.pending_invites.keys())) relevant_rooms.extend(sorted(self.core.pending_invites.keys()))
bookmarks = {str(elem.jid): False for elem in self.core.bookmarks} bookmarks = [str(elem.jid) for elem in self.core.bookmarks]
for tab in self.core.get_tabs(tabs.MucTab): to_suggest = []
name = tab.name for bookmark in bookmarks:
if name in bookmarks and not tab.joined: tab = self.core.get_tab_by_name(bookmark, tabs.MucTab)
bookmarks[name] = True if not tab or (tab and not tab.joined):
relevant_rooms.extend(sorted(room[0] for room in bookmarks.items() if room[1])) to_suggest.append(bookmark)
relevant_rooms.extend(sorted(to_suggest))
if the_input.last_completion: if the_input.last_completion:
return Completion(the_input.new_completion, [], 1, quotify=True) return Completion(the_input.new_completion, [], 1, quotify=True)