summaryrefslogtreecommitdiff
path: root/src/core/completions.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/completions.py')
-rw-r--r--src/core/completions.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/completions.py b/src/core/completions.py
index 1df8d23d..75122885 100644
--- a/src/core/completions.py
+++ b/src/core/completions.py
@@ -249,7 +249,12 @@ def completion_invite(self, the_input):
"""Completion for /invite"""
n = the_input.get_argument_position(quoted=True)
if n == 1:
- return the_input.new_completion(sorted(jid for jid in roster.jids()), n, quotify=True)
+ comp = reduce(lambda x, y: x + [i.jid for i in y], (roster[jid].resources for jid in roster.jids() if len(roster[jid])), [])
+ comp = sorted(comp)
+ bares = sorted(roster[contact].bare_jid for contact in roster.jids() if len(roster[contact]))
+ off = sorted(jid for jid in roster.jids() if jid not in bares)
+ comp = comp + bares + off
+ return the_input.new_completion(comp, n, quotify=True)
elif n == 2:
rooms = []
for tab in self.get_tabs(tabs.MucTab):