From 115006fa141db7dc828ee3168db45c00dd710795 Mon Sep 17 00:00:00 2001 From: Stephan Erb Date: Thu, 8 May 2008 22:15:56 +0000 Subject: [PATCH] Fix add_transport function. TODO: Use it.... xD --- src/roster_window.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 65f24a6e4..19e41c05e 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -718,14 +718,17 @@ class RosterWindow: return True + # TODO: This function is yet unused! Port to new API def add_transport(self, jid, account): '''Add transport to roster and draw it. Return the added contact instance.''' - contact = gajim.contacts.create_contact(jid = jid, name = jid, - groups = [_('Transports')], show = 'offline', - status = 'offline', sub = 'from') - gajim.contacts.add_contact(account, contact) - self.add_contact(transport, account) + contact = gajim.contacts.get_contact_with_highest_priority(account, jid) + if contact is None: + contact = gajim.contacts.create_contact(jid = jid, name = jid, + groups = [_('Transports')], show = 'offline', + status = 'offline', sub = 'from') + gajim.contacts.add_contact(account, contact) + self.add_contact(jid, account) return contact