comparison src/plugins/plugin_xep_0060.py @ 2148:a543eda2c923

core (memory/disco): getInfos now handle node + use client instead of profile in many methods
author Goffi <goffi@goffi.org>
date Sun, 12 Feb 2017 20:43:20 +0100
parents 33c8c4973743
children dd53d7a3219a
comparison
equal deleted inserted replaced
2147:bca699faf416 2148:a543eda2c923
98 client.pubsub_client = SatPubSubClient(self.host, self) 98 client.pubsub_client = SatPubSubClient(self.host, self)
99 return client.pubsub_client 99 return client.pubsub_client
100 100
101 @defer.inlineCallbacks 101 @defer.inlineCallbacks
102 def profileConnected(self, client): 102 def profileConnected(self, client):
103 pubsub_services = yield self.host.findServiceEntities("pubsub", "service", profile=client.profile) 103 pubsub_services = yield self.host.findServiceEntities(client, "pubsub", "service")
104 if pubsub_services: 104 if pubsub_services:
105 # we use one of the found services as our default pubsub service 105 # we use one of the found services as our default pubsub service
106 client.pubsub_service = pubsub_services.pop() 106 client.pubsub_service = pubsub_services.pop()
107 else: 107 else:
108 client.pubsub_service = None 108 client.pubsub_service = None
226 # @param service (JID): target service 226 # @param service (JID): target service
227 # @param nodeIdentifier (str): the parent node name (leave empty to retrieve first-level nodes) 227 # @param nodeIdentifier (str): the parent node name (leave empty to retrieve first-level nodes)
228 # @param profile (str): %(doc_profile)s 228 # @param profile (str): %(doc_profile)s
229 # @return: deferred which fire a list of nodes 229 # @return: deferred which fire a list of nodes
230 # """ 230 # """
231 # d = self.host.getDiscoItems(service, nodeIdentifier, profile_key=profile) 231 # client = self.host.getClient(profile)
232 # d = self.host.getDiscoItems(client, service, nodeIdentifier)
232 # d.addCallback(lambda result: [item.getAttribute('node') for item in result.toElement().children if item.hasAttribute('node')]) 233 # d.addCallback(lambda result: [item.getAttribute('node') for item in result.toElement().children if item.hasAttribute('node')])
233 # return d 234 # return d
234 235
235 # def listSubscribedNodes(self, service, nodeIdentifier='', filter_='subscribed', profile=C.PROF_KEY_NONE): 236 # def listSubscribedNodes(self, service, nodeIdentifier='', filter_='subscribed', profile=C.PROF_KEY_NONE):
236 # """Retrieve the name of the nodes to which the profile is subscribed on the target service. 237 # """Retrieve the name of the nodes to which the profile is subscribed on the target service.