comparison src/memory/memory.py @ 946:fe181994246a

core(memory): fixed last resource
author Goffi <goffi@goffi.org>
date Fri, 28 Mar 2014 19:11:00 +0100
parents e1842ebcb2f3
children 301b342c697a
comparison
equal deleted inserted replaced
945:899dc9cd0f35 946:fe181994246a
327 if not profile: 327 if not profile:
328 raise exceptions.ProfileUnknownError(_('Trying to get entity data for a non-existant profile')) 328 raise exceptions.ProfileUnknownError(_('Trying to get entity data for a non-existant profile'))
329 entity_data = self._getEntitiesData(entity_jid, profile)[entity_jid] 329 entity_data = self._getEntitiesData(entity_jid, profile)[entity_jid]
330 resource = entity_jid.resource 330 resource = entity_jid.resource
331 if resource: 331 if resource:
332 entity_data[C.ENTITY_LAST_RESOURCE] = resource 332 self.updateEntityData(entity_jid.userhostJID(), C.ENTITY_LAST_RESOURCE, resource, profile)
333 entity_data.setdefault("presence", {})[resource or ''] = (show, priority, statuses) 333 entity_data.setdefault("presence", {})[resource or ''] = (show, priority, statuses)
334 334
335 def _getEntitiesData(self, entity_jid, profile): 335 def _getEntitiesData(self, entity_jid, profile):
336 """Get data dictionary for entities 336 """Get data dictionary for entities
337 @param entity_jid: JID of the entity, or C.ENTITY_ALL for all entities) 337 @param entity_jid: JID of the entity, or C.ENTITY_ALL for all entities)