From adca9c455d9d5c1c7991d7d849a947f5cc9fc346 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 12 Dec 2017 01:07:25 +0100 Subject: [PATCH] plugin XEP-0060: added an config option to set pubsub service "pubsub_service" can now be used in [DEFAULT] section. If not found or invalid, first pubsub service found will be used fix 216 --- src/plugins/plugin_xep_0060.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/plugin_xep_0060.py b/src/plugins/plugin_xep_0060.py index 99e6d4e4..2b02024e 100755 --- a/src/plugins/plugin_xep_0060.py +++ b/src/plugins/plugin_xep_0060.py @@ -121,7 +121,11 @@ class XEP_0060(object): @defer.inlineCallbacks def profileConnected(self, client): client.pubsub_watching = set() - client.pubsub_service = yield self.host.findServiceEntity(client, "pubsub", "service") + try: + client.pubsub_service = jid.JID(self.host.memory.getConfig('', 'pubsub_service')) + except RuntimeError: + log.info(_(u"Can't retrieve pubsub_service from conf, we'll use first one that we find")) + client.pubsub_service = yield self.host.findServiceEntity(client, "pubsub", "service") def getFeatures(self, profile): try: