Philipp Hörist pushed to branch mainwindow at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/common/modules/contacts.py
    ... ... @@ -154,9 +154,22 @@ def get_resource(self, resource):
    154 154
                 contact = self.add_resource(resource)
    
    155 155
             return contact
    
    156 156
     
    
    157
    +    def get_resources(self):
    
    158
    +        resources = []
    
    159
    +        for contact in self._resources.values():
    
    160
    +            if contact.show != PresenceShowExt.OFFLINE:
    
    161
    +                resources.append(contact)
    
    162
    +        return resources
    
    163
    +
    
    164
    +    def iter_resources(self):
    
    165
    +        for contact in self._resources.values():
    
    166
    +            if contact.show != PresenceShowExt.OFFLINE:
    
    167
    +                yield contact
    
    168
    +
    
    157 169
         @property
    
    158 170
         def is_available(self):
    
    159
    -        return any([contact.is_available for contact in self._resources.values()])
    
    171
    +        return any([contact.is_available for contact
    
    172
    +                    in self._resources.values()])
    
    160 173
     
    
    161 174
         @property
    
    162 175
         def show(self):