diff options
author | mathieui <mathieui@mathieui.net> | 2012-04-27 22:34:12 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-04-27 22:34:12 +0200 |
commit | 2957cded911a75bfae9e6818d3670efb1570e988 (patch) | |
tree | 4935cda5ec96c538fbf6302fbae2f303ffe893c9 /src/tabs.py | |
parent | 6743bb5d9498ce6a9bc96be66b0527743942b459 (diff) | |
download | poezio-2957cded911a75bfae9e6818d3670efb1570e988.tar.gz poezio-2957cded911a75bfae9e6818d3670efb1570e988.tar.bz2 poezio-2957cded911a75bfae9e6818d3670efb1570e988.tar.xz poezio-2957cded911a75bfae9e6818d3670efb1570e988.zip |
Fix the completion for all commands manipulating the roster
Diffstat (limited to 'src/tabs.py')
-rw-r--r-- | src/tabs.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tabs.py b/src/tabs.py index 9a8f3794..e33b5a9a 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -627,7 +627,7 @@ class MucTab(ChatTab): compare_users = lambda x: x.last_talked userlist = [user.nick for user in sorted(self.users, key=compare_users, reverse=True)\ if user.nick != self.own_nick] - contact_list = [contact.bare_jid for contact in roster.get_contacts()] + contact_list = [jid for jid in roster.jids()] userlist.extend(contact_list) return the_input.auto_completion(userlist, '') @@ -1962,7 +1962,7 @@ class RosterInfoTab(Tab): """ From with any JID presence in the roster """ - jids = [contact.bare_jid for contact in roster.get_contacts()] + jids = [jid for jid in roster.jids()] return the_input.auto_completion(jids, '') def completion_name(self, the_input): @@ -1972,7 +1972,7 @@ class RosterInfoTab(Tab): n += 1 if n == 2: - jids = [contact.bare_jid for contact in roster.get_contacts()] + jids = [jid for jid in roster.jids()] return the_input.auto_completion(jids, '') return False @@ -1983,10 +1983,10 @@ class RosterInfoTab(Tab): n += 1 if n == 2: - jids = [contact.bare_jid for contact in roster.get_contacts()] + jids = [jid for jid in roster.jids()] return the_input.auto_completion(jids, '') elif n == 3: - groups = [group.name for group in roster.get_groups() if group.name != 'none'] + groups = [group for group in roster.groups if group != 'none'] return the_input.auto_completion(groups, '') return False @@ -1998,11 +1998,11 @@ class RosterInfoTab(Tab): n += 1 if n == 2: - jids = [contact.bare_jid for contact in roster.get_contacts()] + jids = [jid for jid in roster.jids()] return the_input.auto_completion(jids, '') elif n == 3: - contact = roster.get_contact_by_jid(args[1]) - if not contact: + contact = roster[args[1]] + if contact is None: return False groups = list(contact.groups) try: @@ -2017,8 +2017,8 @@ class RosterInfoTab(Tab): Complete the first argument from the list of the contact with ask=='subscribe' """ - jids = [contact.bare_jid for contact in roster.get_contacts()\ - if contact.ask == 'asked'] + jids = [str(contact.bare_jid) for contact in roster.contacts.values()\ + if contact.pending_in] return the_input.auto_completion(jids, '') def command_accept(self, args): |