diff options
author | mathieui <mathieui@mathieui.net> | 2012-04-18 00:09:12 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-04-18 00:09:12 +0200 |
commit | aef2a905d1a1c54a747d7ed0e07f3e123acac75c (patch) | |
tree | a3cb3515b4871b41d935ba2d9bd0c31090f7dd70 | |
parent | 43b28a1ab0311e16e30711966874d35e2fae254e (diff) | |
download | poezio-aef2a905d1a1c54a747d7ed0e07f3e123acac75c.tar.gz poezio-aef2a905d1a1c54a747d7ed0e07f3e123acac75c.tar.bz2 poezio-aef2a905d1a1c54a747d7ed0e07f3e123acac75c.tar.xz poezio-aef2a905d1a1c54a747d7ed0e07f3e123acac75c.zip |
Refactor command_list a bit
-rw-r--r-- | src/core.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core.py b/src/core.py index 22dae4cd..d700d9dc 100644 --- a/src/core.py +++ b/src/core.py @@ -1576,16 +1576,15 @@ class Core(object): /list <server> Opens a MucListTab containing the list of the room in the specified server """ - args = arg.split() - if len(args) > 1: - self.command_help('list') - return - elif len(args) == 0: + arg = arg.split() + if len(arg) > 1: + return self.command_help('list') + elif arg: + server = JID(arg[0]).server + else: if not isinstance(self.current_tab(), tabs.MucTab): return self.information('Please provide a server', 'Error') server = JID(self.current_tab().get_name()).server - else: - server = arg.strip() list_tab = tabs.MucListTab(server) self.add_tab(list_tab, True) self.xmpp.plugin['xep_0030'].get_items(jid=server, block=False, callback=list_tab.on_muc_list_item_received) |