# HG changeset patch # User souliane # Date 1413570361 -7200 # Node ID 22adf1eb59f598383ec5e9111f3f3610ea7002c5 # Parent b6dbac8ee4854fb5f825706fd8671cc53cc96da1 memory: don't save last resource in entity data for the MUC jids diff -r b6dbac8ee485 -r 22adf1eb59f5 src/memory/memory.py --- a/src/memory/memory.py Fri Oct 17 15:49:46 2014 +0200 +++ b/src/memory/memory.py Fri Oct 17 20:26:01 2014 +0200 @@ -423,7 +423,12 @@ 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):