Skip to content
Snippets Groups Projects
Commit ea26f8ea authored by js's avatar js
Browse files

If no resource is left, we shouldn't have caps left either!

parent 701fe426
No related branches found
No related tags found
No related merge requests found
......@@ -180,9 +180,17 @@ class CapsCache(object):
con.discoverInfo(jid, '%s#%s' % (node, hash))
def is_supported(self, contact, feature):
# No resource -> can't have any caps
if not contact or not contact.resource:
return False
# Unfortunately, if all resources are offline, the contact
# includes the last resource that was online. Check for its
# show, so we can be sure it's existant. Otherwise, we still
# return caps for a contact that has no resources left.
if contact.show == 'offline':
return False
# FIXME: We assume everything is supported if we got no caps.
# This is the "Asterix way", after 0.12 release, I will
# likely implement a fallback to disco (could be disabled
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment