Changeset 9594

Show
Ignore:
Timestamp:
05/07/08 19:42:42 (3 months ago)
Author:
steve-e
Message:

Allow to have several SelfContact? jids in merged accounts mode. Previously only one was shown.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/roster_window.py

    r9588 r9594  
    124124                 
    125125 
    126         def _get_self_contact_iter(self, account, model = None): 
     126        def _get_self_contact_iter(self, jid, account, model = None): 
    127127                ''' Return the gtk.TreeIter of SelfContact or None if not found. 
    128128 
    129129                Keyword arguments: 
     130                jid -- the jid of SelfContact 
    130131                account -- the account of SelfContact 
    131132                model -- the data model (default TreeFilterModel) 
     
    136137                        model = self.modelfilter 
    137138                iterAcct = self._get_account_iter(account, model) 
    138                 iter = model.iter_children(iterAcct) 
    139                 if iter and model[iter][C_TYPE] == 'self_contact': 
    140                         return iter 
     139                iterC = model.iter_children(iterAcct) 
     140                 
     141                # There might be several SelfContacts in merged account view 
     142                while iterC: 
     143                        if model[iterC][C_TYPE] != 'self_contact': 
     144                                break 
     145                        iter_jid = model[iterC][C_JID] 
     146                        if iter_jid and jid == iter_jid.decode('utf-8'): 
     147                                return iterC 
     148                        iterC = model.iter_next(iterC) 
    141149                return None 
    142150 
     
    158166 
    159167                if jid == gajim.get_jid_from_account(account): 
    160                         iter = self._get_self_contact_iter(account, model) 
     168                        iter = self._get_self_contact_iter(jid, account, model) 
    161169                        if iter: 
    162170                                return [iter]