Changeset 6261 for trunk/src/gajim.py

Show
Ignore:
Timestamp:
05/01/06 20:29:12 (3 years ago)
Author:
asterix
Message:

be sure that transport is really removed before we start to remove its contacts.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gajim.py

    r6235 r6261  
    730730                        return 
    731731 
     732        def handle_event_agent_removed(self, account, agent): 
     733                # remove transport's contacts from treeview 
     734                jid_list = gajim.contacts.get_jid_list(account) 
     735                for jid in jid_list: 
     736                        if jid.endswith('@' + agent): 
     737                                c = gajim.contacts.get_first_contact_from_jid(account, jid) 
     738                                gajim.log.debug( 
     739                                        'Removing contact %s due to unregistered transport %s'\ 
     740                                        % (jid, agent)) 
     741                                gajim.connections[account].unsubscribe(c.jid) 
     742                                # Transport contacts can't have 2 resources 
     743                                if c.jid in gajim.to_be_removed[account]: 
     744                                        # This way we'll really remove it 
     745                                        gajim.to_be_removed[account].remove(c.jid) 
     746                                gajim.contacts.remove_jid(account, c.jid) 
     747                                self.roster.remove_contact(c, account) 
     748 
    732749        def handle_event_register_agent_info(self, account, array): 
    733750                #('REGISTER_AGENT_INFO', account, (agent, infos, is_form)) 
     
    16241641                        'AGENT_ERROR_INFO': self.handle_event_agent_info_error, 
    16251642                        'AGENT_ERROR_ITEMS': self.handle_event_agent_items_error, 
     1643                        'AGENT_REMOVED': self.handle_event_agent_removed, 
    16261644                        'REGISTER_AGENT_INFO': self.handle_event_register_agent_info, 
    16271645                        'AGENT_INFO_ITEMS': self.handle_event_agent_info_items,