changeset 2597:9446f1ea9eac

core: discoFindByFeatures now return only available resources
author Goffi <goffi@goffi.org>
date Fri, 25 May 2018 10:52:01 +0200
parents 93d64ce7a429
children 0b6adc2672d9
files sat/core/sat_main.py sat/memory/memory.py sat_frontends/tools/xmlui.py
diffstat 3 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/sat_main.py	Fri May 25 10:52:01 2018 +0200
+++ b/sat/core/sat_main.py	Fri May 25 10:52:01 2018 +0200
@@ -728,7 +728,7 @@
                         resources = [None]
                     else:
                         try:
-                            resources = self.memory.getAllResources(client, jid_)
+                            resources = self.memory.getAvailableResources(client, jid_)
                         except exceptions.UnknownEntityError:
                             continue
                 for resource in resources:
--- a/sat/memory/memory.py	Fri May 25 10:52:01 2018 +0200
+++ b/sat/memory/memory.py	Fri May 25 10:52:01 2018 +0200
@@ -655,6 +655,7 @@
         @raise exceptions.UnknownEntityError: if entity is not in cache
         @raise ValueError: entity_jid has a resource
         """
+        # FIXME: is there a need to keep cache data for resources which are not connected anymore?
         if entity_jid.resource:
             raise ValueError("getAllResources must be used with a bare jid (got {})".format(entity_jid))
         profile_cache = self._getProfileCache(client)
--- a/sat_frontends/tools/xmlui.py	Fri May 25 10:52:01 2018 +0200
+++ b/sat_frontends/tools/xmlui.py	Fri May 25 10:52:01 2018 +0200
@@ -266,7 +266,7 @@
 
     def _defaultCb(self, data, cb_id, profile):
         # TODO: when XMLUI updates will be managed, the _xmluiClose
-        #       must be called only if there is not update
+        #       must be called only if there is no update
         self._xmluiClose()
         self.host.actionManager(data, profile=profile)