# HG changeset patch # User Goffi # Date 1561902747 -7200 # Node ID bad0b4280b7742145a6739670e491d02d34af1ee # Parent 06f30ad8e110b5e371ff98654af4785fcc707272 quick frontends (contact list): ignore roster entities with a resource: cache uses bare entities, as a result when a jid with a resource is used in roster, it is not handled properly. As this case is rare and probably resulting from bugs in clients, entities with resources are ignored and a warning is logged when this happens. fix 306 diff -r 06f30ad8e110 -r bad0b4280b77 sat_frontends/quick_frontend/quick_contact_list.py --- a/sat_frontends/quick_frontend/quick_contact_list.py Sun Jun 30 15:43:57 2019 +0200 +++ b/sat_frontends/quick_frontend/quick_contact_list.py Sun Jun 30 15:52:27 2019 +0200 @@ -22,14 +22,13 @@ from sat.core.i18n import _ from sat.core.log import getLogger - -log = getLogger(__name__) from sat.core import exceptions from sat_frontends.quick_frontend.quick_widgets import QuickWidget from sat_frontends.quick_frontend.constants import Const as C from sat_frontends.tools import jid from collections import OrderedDict +log = getLogger(__name__) try: # FIXME: to be removed when an acceptable solution is here @@ -234,6 +233,14 @@ @param contacts(tuple): all contacts """ for contact in contacts: + entity = jid.JID(contact[0]) + if entity.resource: + # we use entity's bare jid to cache data, so a resource here + # will cause troubles + log.warning( + "Roster entities with resources are not managed, ignoring {entity}" + .format(entity=entity)) + continue self.host.newContactHandler(*contact, profile=self.profile) handler._contactsFilled(self.profile)