From 8aa58284596efbe98aacfb35f103d0849a2bd751 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 28 Dec 2012 19:24:13 +0100 Subject: Fix #2174 /server_cycle now takes a suffix and will match all the rooms with this same suffix. It also means that /server_cycle room@domain.tld will now only cycle root@domain.tld instead of all the rooms of domain.tld. --- src/core.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/core.py b/src/core.py index 0b684c48..d99249e5 100644 --- a/src/core.py +++ b/src/core.py @@ -2086,7 +2086,7 @@ class Core(object): self.information(_("No server specified"), "Error") return for tab in self.tabs: - if isinstance(tab, tabs.MucTab) and safeJID(tab.get_name()).domain == domain: + if isinstance(tab, tabs.MucTab) and tab.get_name().endswith(domain): if tab.joined: muc.leave_groupchat(tab.core.xmpp, tab.get_name(), tab.own_nick, message) tab.joined = False @@ -2100,13 +2100,12 @@ class Core(object): if txt.endswith(' '): n += 1 if n == 2: - serv_list = [] + serv_list = set() for tab in self.tabs: if isinstance(tab, tabs.MucTab): serv = safeJID(tab.get_name()).server - if not serv in serv_list: - serv_list.append(serv) - return the_input.auto_completion(serv_list, ' ') + serv_list.add(serv) + return the_input.auto_completion(list(serv_list), ' ') def command_activity(self, arg): """ -- cgit v1.2.3