changeset 2432:c6d859df4b27

plugin XEP-0060: use new findServiceEntity to get default pubsub service
author Goffi <goffi@goffi.org>
date Wed, 15 Nov 2017 08:55:47 +0100
parents a9fac72825a2
children 014feb75092d
files src/plugins/plugin_xep_0060.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0060.py	Wed Nov 15 08:54:32 2017 +0100
+++ b/src/plugins/plugin_xep_0060.py	Wed Nov 15 08:55:47 2017 +0100
@@ -113,12 +113,7 @@
 
     @defer.inlineCallbacks
     def profileConnected(self, client):
-        pubsub_services = yield self.host.findServiceEntities(client, "pubsub", "service")
-        if pubsub_services:
-            # we use one of the found services as our default pubsub service
-            client.pubsub_service = pubsub_services.pop()
-        else:
-            client.pubsub_service = None
+        client.pubsub_service = yield self.host.findServiceEntity(client, "pubsub", "service")
 
     def getFeatures(self, profile):
         try: