comparison sat_pubsub/delegation.py @ 334:0a93d71f9503

delegation: use same disco for all pubsub namespaces
author Goffi <goffi@goffi.org>
date Sat, 03 Jun 2017 16:12:46 +0200
parents 54d90c73b8b5
children 3bbab2173ebc
comparison
equal deleted inserted replaced
333:0fcd0ea89c84 334:0a93d71f9503
230 230
231 if not namespace: 231 if not namespace:
232 log.msg("No namespace found in node {}".format(nodeIdentifier)) 232 log.msg("No namespace found in node {}".format(nodeIdentifier))
233 return [] 233 return []
234 234
235 if namespace.startswith(pubsub.NS_PUBSUB):
236 # pubsub use several namespaces starting with NS_PUBSUB (e.g. http://jabber.org/protocol/pubsub#owner)
237 # we return the same disco for all of them
238 namespace = pubsub.NS_PUBSUB
239
235 def gotInfos(infos): 240 def gotInfos(infos):
236 ns_features = [] 241 ns_features = []
237 for info in infos: 242 for info in infos:
238 if isinstance(info, disco.DiscoFeature) and info.startswith(namespace): 243 if isinstance(info, disco.DiscoFeature) and info.startswith(namespace):
239 ns_features.append(info) 244 ns_features.append(info)