quick_frontend: allow presence of entities without resource

This commit is contained in:
Goffi 2016-06-29 13:42:35 +02:00
commit c1c7b0446c

View file

@ -471,7 +471,8 @@ class ProfileContactList(object):
if not cache[C.CONTACT_RESOURCES]:
cache[C.CONTACT_MAIN_RESOURCE] = None
else:
assert entity.resource
if not entity.resource:
log.warning(_(u"received presence from entity without resource: {}".format(entity)))
resources_data = cache[C.CONTACT_RESOURCES]
resource_data = resources_data.setdefault(entity.resource, {})
resource_data[C.PRESENCE_SHOW] = show