summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-04-27 20:50:55 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2019-04-27 21:46:18 +0100
commit05019c4f2becfa10746a209ad9eff5b67e7c9119 (patch)
treedd863b531ef91dca28f8d3ac0bd5395ee91a48ba
parent5a7bc16fe14e9af66a5e062c1e22af065b4db40b (diff)
downloadpoezio-05019c4f2becfa10746a209ad9eff5b67e7c9119.tar.gz
poezio-05019c4f2becfa10746a209ad9eff5b67e7c9119.tar.bz2
poezio-05019c4f2becfa10746a209ad9eff5b67e7c9119.tar.xz
poezio-05019c4f2becfa10746a209ad9eff5b67e7c9119.zip
core/completions: Use tab.jid where appropriate
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/core/completions.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/poezio/core/completions.py b/poezio/core/completions.py
index 87bb2d47..84de77ca 100644
--- a/poezio/core/completions.py
+++ b/poezio/core/completions.py
@@ -161,8 +161,8 @@ class CompletionCore:
muc_serv_list = []
for tab in self.core.get_tabs(
tabs.MucTab): # TODO, also from an history
- if tab.name not in muc_serv_list:
- muc_serv_list.append(safeJID(tab.name).server)
+ if tab.jid.server not in muc_serv_list:
+ muc_serv_list.append(tab.jid.server)
if muc_serv_list:
return Completion(
the_input.new_completion, muc_serv_list, 1, quotify=False)
@@ -284,7 +284,7 @@ class CompletionCore:
rooms = []
for tab in self.core.get_tabs(tabs.MucTab):
if tab.joined:
- rooms.append(tab.name)
+ rooms.append(tab.jid.bare)
rooms.sort()
return Completion(
the_input.new_completion, rooms, n, '', quotify=True)
@@ -346,8 +346,7 @@ class CompletionCore:
"""Completion for /server_cycle"""
serv_list = set()
for tab in self.core.get_tabs(tabs.MucTab):
- serv = safeJID(tab.name).server
- serv_list.add(serv)
+ serv_list.add(tab.jid.server)
return Completion(the_input.new_completion, sorted(serv_list), 1, ' ')
def set(self, the_input):