memory: don't save last resource in entity data for the MUC jids

This commit is contained in:
souliane 2014-10-17 20:26:01 +02:00
commit 2f6b8ae771

View file

@ -423,7 +423,12 @@ class Memory(object):
entity_data = self._getEntitiesData(entity_jid, profile)[entity_jid]
resource = entity_jid.resource
if resource:
self.updateEntityData(entity_jid.userhostJID(), C.ENTITY_LAST_RESOURCE, resource, profile)
try:
type_ = self.getEntityDatum(entity_jid.userhostJID(), 'type', profile)
except KeyError:
type_ = 'contact'
if type_ != 'chatroom':
self.updateEntityData(entity_jid.userhostJID(), C.ENTITY_LAST_RESOURCE, resource, profile)
entity_data.setdefault("presence", {})[resource or ''] = (show, priority, statuses)
def _getEntitiesData(self, entity_jid, profile):