Show
Ignore:
Timestamp:
08/31/07 10:27:15 (15 months ago)
Author:
asterix
Message:

show transport nickname if there is one and user hasn't set a nickname. fixes #3094

Location:
branches/gajim_0.11.1/src/common
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/connection_handlers.py

    r8629 r8661  
    15831583                if not user_nick: 
    15841584                        user_nick = '' 
     1585                contact_nickname = None 
    15851586                transport_auto_auth = False 
    15861587                xtags = prs.getTags('x') 
     
    15931594                        if namespace == common.xmpp.NS_VCARD_UPDATE: 
    15941595                                avatar_sha = x.getTagData('photo') 
    1595                         if namespace == common.xmpp.NS_DELAY: 
     1596                                contact_nickname = x.getTagData('nickname') 
     1597                        elif namespace == common.xmpp.NS_DELAY: 
    15961598                                # JEP-0091 
    15971599                                tim = prs.getTimestamp() 
     
    16321634                                if errcode == '502': # Internal Timeout: 
    16331635                                        self.dispatch('NOTIFY', (jid_stripped, 'error', errmsg, resource, 
    1634                                                 prio, keyID, timestamp)) 
     1636                                                prio, keyID, timestamp, None)) 
    16351637                                elif errcode == '401': # password required to join 
    16361638                                        self.dispatch('ERROR', (_('Unable to join group chat'), 
     
    17171719                                if who.find("@") <= 0 or transport_auto_auth: 
    17181720                                        self.dispatch('NOTIFY', (jid_stripped, 'offline', 'offline', 
    1719                                                 resource, prio, keyID, timestamp)) 
     1721                                                resource, prio, keyID, timestamp, None)) 
    17201722                                if transport_auto_auth: 
    17211723                                        self.automatically_added.append(jid_stripped) 
     
    17681770                        if errcode == '502': # Internal Timeout: 
    17691771                                self.dispatch('NOTIFY', (jid_stripped, 'error', errmsg, resource, 
    1770                                         prio, keyID, timestamp)) 
     1772                                        prio, keyID, timestamp, None)) 
    17711773                        else:   # print in the window the error 
    17721774                                self.dispatch('ERROR_ANSWER', ('', jid_stripped, 
     
    17921794                                        self.dispatch('ERROR', (_('Disk Write Error'), str(e))) 
    17931795                        self.dispatch('NOTIFY', (jid_stripped, show, status, resource, prio, 
    1794                                 keyID, timestamp)) 
     1796                                keyID, timestamp, contact_nickname)) 
    17951797        # END presenceCB 
    17961798        def _StanzaArrivedCB(self, con, obj): 
  • branches/gajim_0.11.1/src/common/contacts.py

    r8590 r8661  
    2424                self.jid = jid 
    2525                self.name = name 
     26                self.contact_name = '' # nick choosen by contact 
    2627                self.groups = groups 
    2728                self.show = show 
     
    5859                if self.name: 
    5960                        return self.name 
     61                if self.contact_name: 
     62                        return self.contact_name 
    6063                return self.jid.split('@')[0] 
    6164