comparison cagou/plugins/plugin_wid_contact_list.py @ 440:167c3e198f73

contact list: fixed crash on update when profile is not specified
author Goffi <goffi@goffi.org>
date Sat, 07 Mar 2020 00:05:50 +0100
parents f7476818f9fb
children 3c9ba4a694ef
comparison
equal deleted inserted replaced
439:12d188cb1206 440:167c3e198f73
168 log.debug("update: %s %s %s" % (entities, type_, profile)) 168 log.debug("update: %s %s %s" % (entities, type_, profile))
169 if type_ == None or type_ == C.UPDATE_STRUCTURE: 169 if type_ == None or type_ == C.UPDATE_STRUCTURE:
170 log.debug("full contact list update") 170 log.debug("full contact list update")
171 self.layout.clear_widgets() 171 self.layout.clear_widgets()
172 for bare_jid, data in self.items_sorted.items(): 172 for bare_jid, data in self.items_sorted.items():
173 wid = CLContactItem(profile=profile, data=data, jid=bare_jid, main_wid=self) 173 wid = CLContactItem(
174 profile=data['profile'],
175 data=data,
176 jid=bare_jid,
177 main_wid=self,
178 )
174 self.layout.add_widget(wid) 179 self.layout.add_widget(wid)
175 self._wid_map[(profile, bare_jid)] = wid 180 self._wid_map[(profile, bare_jid)] = wid
176 elif type_ == C.UPDATE_MODIFY: 181 elif type_ == C.UPDATE_MODIFY:
177 for entity in entities: 182 for entity in entities:
178 entity_bare = entity.bare 183 entity_bare = entity.bare