Do not split on command_accept as it is unneeded

This commit is contained in:
mathieui 2012-04-18 00:22:30 +02:00
parent 5c06af299e
commit c2e122d873

View file

@ -2015,12 +2015,11 @@ class RosterInfoTab(Tab):
if contact.ask == 'asked'] if contact.ask == 'asked']
return the_input.auto_completion(jids, '') return the_input.auto_completion(jids, '')
def command_accept(self, args): def command_accept(self, arg):
""" """
Accept a JID from in roster. Authorize it AND subscribe to it Accept a JID from in roster. Authorize it AND subscribe to it
""" """
args = args.split() if not arg:
if not args:
item = self.roster_win.selected_row item = self.roster_win.selected_row
if isinstance(item, Contact) and item.ask == 'asked': if isinstance(item, Contact) and item.ask == 'asked':
jid = item.bare_jid jid = item.bare_jid
@ -2028,7 +2027,7 @@ class RosterInfoTab(Tab):
self.core.information('No subscription to accept') self.core.information('No subscription to accept')
return return
else: else:
jid = args[0] jid = JID(arg).bare
self.core.xmpp.sendPresence(pto=jid, ptype='subscribed') self.core.xmpp.sendPresence(pto=jid, ptype='subscribed')
self.core.xmpp.sendPresence(pto=jid, ptype='') self.core.xmpp.sendPresence(pto=jid, ptype='')
contact = roster.get_contact_by_jid(jid) contact = roster.get_contact_by_jid(jid)