Refactor command_list a bit
This commit is contained in:
parent
43b28a1ab0
commit
aef2a905d1
1 changed files with 6 additions and 7 deletions
13
src/core.py
13
src/core.py
|
@ -1576,16 +1576,15 @@ class Core(object):
|
||||||
/list <server>
|
/list <server>
|
||||||
Opens a MucListTab containing the list of the room in the specified server
|
Opens a MucListTab containing the list of the room in the specified server
|
||||||
"""
|
"""
|
||||||
args = arg.split()
|
arg = arg.split()
|
||||||
if len(args) > 1:
|
if len(arg) > 1:
|
||||||
self.command_help('list')
|
return self.command_help('list')
|
||||||
return
|
elif arg:
|
||||||
elif len(args) == 0:
|
server = JID(arg[0]).server
|
||||||
|
else:
|
||||||
if not isinstance(self.current_tab(), tabs.MucTab):
|
if not isinstance(self.current_tab(), tabs.MucTab):
|
||||||
return self.information('Please provide a server', 'Error')
|
return self.information('Please provide a server', 'Error')
|
||||||
server = JID(self.current_tab().get_name()).server
|
server = JID(self.current_tab().get_name()).server
|
||||||
else:
|
|
||||||
server = arg.strip()
|
|
||||||
list_tab = tabs.MucListTab(server)
|
list_tab = tabs.MucListTab(server)
|
||||||
self.add_tab(list_tab, True)
|
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)
|
self.xmpp.plugin['xep_0030'].get_items(jid=server, block=False, callback=list_tab.on_muc_list_item_received)
|
||||||
|
|
Loading…
Reference in a new issue