Show
Ignore:
Timestamp:
05/09/08 00:15:56 (7 months ago)
Author:
steve-e
Message:

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/roster_window.py

    r9599 r9600  
    719719                 
    720720 
     721        # TODO: This function is yet unused! Port to new API 
    721722        def add_transport(self, jid, account): 
    722723                '''Add transport to roster and draw it. 
    723724                Return the added contact instance.''' 
    724                 contact = gajim.contacts.create_contact(jid = jid, name = jid, 
    725                         groups = [_('Transports')], show = 'offline',  
    726                         status = 'offline', sub = 'from') 
    727                 gajim.contacts.add_contact(account, contact) 
    728                 self.add_contact(transport, account) 
     725                contact = gajim.contacts.get_contact_with_highest_priority(account, jid) 
     726                if contact is None:      
     727                        contact = gajim.contacts.create_contact(jid = jid, name = jid, 
     728                                groups = [_('Transports')], show = 'offline',  
     729                                status = 'offline', sub = 'from') 
     730                        gajim.contacts.add_contact(account, contact) 
     731                self.add_contact(jid, account) 
    729732                return contact 
    730733