Changeset 10015

Show
Ignore:
Timestamp:
07/23/08 20:38:52 (3 months ago)
Author:
js
Message:

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/caps.py

    r10013 r10015  
    181181         
    182182        def is_supported(self, contact, feature): 
     183                # No resource -> can't have any caps 
    183184                if not contact or not contact.resource: 
     185                        return False 
     186 
     187                # Unfortunately, if all resources are offline, the contact 
     188                # includes the last resource that was online. Check for its 
     189                # show, so we can be sure it's existant. Otherwise, we still 
     190                # return caps for a contact that has no resources left. 
     191                if contact.show == 'offline': 
    184192                        return False 
    185193