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
This commit is contained in:
Goffi 2017-12-12 01:07:25 +01:00
commit adca9c455d

View file

@ -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: