Fix /last_activity (8/78)

This commit is contained in:
mathieui 2014-12-19 22:19:37 +01:00
parent db60b72cf1
commit d932921be3
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -154,10 +154,10 @@ class ConversationTab(OneToOneTab):
@command_args_parser.quoted(0, 1)
def command_last_activity(self, args):
"""
/activity [jid]
/last_activity [jid]
"""
if args is not None:
return self.core.command_last_activity(arg[0])
if args and args[0]:
return self.core.command_last_activity(args[0])
def callback(iq):
if iq['type'] != 'result':
@ -184,7 +184,7 @@ class ConversationTab(OneToOneTab):
self.add_message(msg)
self.core.refresh_window()
self.core.xmpp.plugin['xep_0012'].get_last_activity(self.general_jid, callback=callback)
self.core.xmpp.plugin['xep_0012'].get_last_activity(self.get_dest_jid(), callback=callback)
@refresh_wrapper.conditional
@command_args_parser.ignored