comparison frontends/src/quick_frontend/quick_contact_list.py @ 1393:50d5d6325f62

quick_frontend, primitivus: various fixes (MUC and cached signals): - actually call the cached signals, everything was there but the call was not done - display '[]' instead of '[None]' when group message coming from the room (no resource) - catch the exception when trying to delete an occupant who's not in the room - do not cache a "main resource" for MUC entities
author souliane <souliane@mailoo.org>
date Wed, 25 Mar 2015 15:25:51 +0100
parents 1276e6a0716b
children 069ad98b360d
comparison
equal deleted inserted replaced
1392:c7082457d03f 1393:50d5d6325f62
294 if attributes[C.CONTACT_SPECIAL] is None: 294 if attributes[C.CONTACT_SPECIAL] is None:
295 del attributes[C.CONTACT_SPECIAL] 295 del attributes[C.CONTACT_SPECIAL]
296 self._specials.remove(entity_bare) 296 self._specials.remove(entity_bare)
297 else: 297 else:
298 self._specials.add(entity_bare) 298 self._specials.add(entity_bare)
299 cache[C.CONTACT_MAIN_RESOURCE] = None
299 300
300 # now the attribute we keep in cache 301 # now the attribute we keep in cache
301 for attribute, value in attributes.iteritems(): 302 for attribute, value in attributes.iteritems():
302 cache[attribute] = value 303 cache[attribute] = value
303 304
399 resource_data = resources_data.setdefault(entity.resource, {}) 400 resource_data = resources_data.setdefault(entity.resource, {})
400 resource_data[C.PRESENCE_SHOW] = show 401 resource_data[C.PRESENCE_SHOW] = show
401 resource_data[C.PRESENCE_PRIORITY] = int(priority) 402 resource_data[C.PRESENCE_PRIORITY] = int(priority)
402 resource_data[C.PRESENCE_STATUSES] = statuses 403 resource_data[C.PRESENCE_STATUSES] = statuses
403 404
404 priority_resource = max(resources_data, key=lambda res: resources_data[res][C.PRESENCE_PRIORITY]) 405 if entity.bare not in self._specials:
405 cache[C.CONTACT_MAIN_RESOURCE] = priority_resource 406 priority_resource = max(resources_data, key=lambda res: resources_data[res][C.PRESENCE_PRIORITY])
407 cache[C.CONTACT_MAIN_RESOURCE] = priority_resource
406 self.update() 408 self.update()
407 409
408 def onNickUpdate(self, entity, new_nick, profile): 410 def onNickUpdate(self, entity, new_nick, profile):
409 """Update entity's nick 411 """Update entity's nick
410 412