Fix add_transport function. TODO: Use it.... xD
This commit is contained in:
parent
56da8d7cfb
commit
115006fa14
|
@ -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.get_contact_with_highest_priority(account, jid)
|
||||||
|
if contact is None:
|
||||||
contact = gajim.contacts.create_contact(jid = jid, name = jid,
|
contact = gajim.contacts.create_contact(jid = jid, name = jid,
|
||||||
groups = [_('Transports')], show = 'offline',
|
groups = [_('Transports')], show = 'offline',
|
||||||
status = 'offline', sub = 'from')
|
status = 'offline', sub = 'from')
|
||||||
gajim.contacts.add_contact(account, contact)
|
gajim.contacts.add_contact(account, contact)
|
||||||
self.add_contact(transport, account)
|
self.add_contact(jid, account)
|
||||||
return contact
|
return contact
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue