Fix add_transport function. TODO: Use it.... xD

This commit is contained in:
Stephan Erb 2008-05-08 22:15:56 +00:00
parent 56da8d7cfb
commit 115006fa14
1 changed files with 8 additions and 5 deletions

View File

@ -718,14 +718,17 @@ class RosterWindow:
return True return True
# TODO: This function is yet unused! Port to new API
def add_transport(self, jid, account): def add_transport(self, jid, account):
'''Add transport to roster and draw it. '''Add transport to roster and draw it.
Return the added contact instance.''' Return the added contact instance.'''
contact = gajim.contacts.create_contact(jid = jid, name = jid, contact = gajim.contacts.get_contact_with_highest_priority(account, jid)
groups = [_('Transports')], show = 'offline', if contact is None:
status = 'offline', sub = 'from') contact = gajim.contacts.create_contact(jid = jid, name = jid,
gajim.contacts.add_contact(account, contact) groups = [_('Transports')], show = 'offline',
self.add_contact(transport, account) status = 'offline', sub = 'from')
gajim.contacts.add_contact(account, contact)
self.add_contact(jid, account)
return contact return contact