Changeset 6261
- Timestamp:
- 05/01/06 20:29:12 (2 years ago)
- Location:
- trunk/src
- Files:
-
- 4 modified
-
common/connection_handlers.py (modified) (2 diffs)
-
common/connection.py (modified) (1 diff)
-
gajim.py (modified) (2 diffs)
-
roster_window.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/connection_handlers.py
r6253 r6261 41 41 VCARD_PUBLISHED = 'vcard_published' 42 42 VCARD_ARRIVED = 'vcard_arrived' 43 AGENT_REMOVED = 'agent_removed' 43 44 HAS_IDLE = True 44 45 try: … … 948 949 elif jid == our_jid: 949 950 self.dispatch('MYVCARD', {'jid': jid}) 951 elif self.awaiting_answers[id][0] == AGENT_REMOVED: 952 jid = self.awaiting_answers[id][1] 953 self.dispatch('AGENT_REMOVED', jid) 950 954 del self.awaiting_answers[id] 951 955 -
trunk/src/common/connection.py
r6253 r6261 745 745 iq = common.xmpp.Iq('set', common.xmpp.NS_REGISTER, to = agent) 746 746 iq.getTag('query').setTag('remove') 747 id = self.connection.getAnID() 748 iq.setID(id) 749 self.awaiting_answers[id] = (AGENT_REMOVED, agent) 747 750 self.connection.send(iq) 748 751 self.connection.getRoster().delItem(agent) -
trunk/src/gajim.py
r6235 r6261 730 730 return 731 731 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 732 749 def handle_event_register_agent_info(self, account, array): 733 750 #('REGISTER_AGENT_INFO', account, (agent, infos, is_form)) … … 1624 1641 'AGENT_ERROR_INFO': self.handle_event_agent_info_error, 1625 1642 'AGENT_ERROR_ITEMS': self.handle_event_agent_items_error, 1643 'AGENT_REMOVED': self.handle_event_agent_removed, 1626 1644 'REGISTER_AGENT_INFO': self.handle_event_register_agent_info, 1627 1645 'AGENT_INFO_ITEMS': self.handle_event_agent_info_items, -
trunk/src/roster_window.py
r6242 r6261 1143 1143 # remove transport from treeview 1144 1144 self.remove_contact(contact, account) 1145 # remove transport's contacts from treeview1146 jid_list = gajim.contacts.get_jid_list(account)1147 for jid in jid_list:1148 if jid.endswith('@' + contact.jid):1149 c = gajim.contacts.get_first_contact_from_jid(account, jid)1150 gajim.log.debug(1151 'Removing contact %s due to unregistered transport %s'\1152 % (jid, contact.jid))1153 gajim.connections[account].unsubscribe(c.jid)1154 # Transport contacts can't have 2 resources1155 gajim.contacts.remove_jid(account, c.jid)1156 self.remove_contact(c, account)1157 1145 gajim.contacts.remove_jid(account, contact.jid) 1158 1146 gajim.contacts.remove_contact(account, contact)
