comparison src/tools/common/uri.py @ 2326:91a14dab924d

tools (common/uri): buildXMPPUri: use XEP-0277 namespace as node if node is empty or None for microblog subtype
author Goffi <goffi@goffi.org>
date Thu, 13 Jul 2017 21:12:46 +0200
parents e5e54ff0b775
children f9adda22a2e1
comparison
equal deleted inserted replaced
2325:760df3a58c24 2326:91a14dab924d
82 subtype = kwargs.pop('subtype', None) 82 subtype = kwargs.pop('subtype', None)
83 path = kwargs.pop('path') 83 path = kwargs.pop('path')
84 uri.append(urllib.quote_plus(path).replace(u'%40', '@')) 84 uri.append(urllib.quote_plus(path).replace(u'%40', '@'))
85 85
86 if type_ == u'pubsub': 86 if type_ == u'pubsub':
87 if subtype == 'microblog' and not 'node' in kwargs: 87 if subtype == 'microblog' and not kwargs.get('node'):
88 kwargs[u'node'] = 'urn:xmpp:microblog:0' 88 kwargs[u'node'] = 'urn:xmpp:microblog:0'
89 if kwargs: 89 if kwargs:
90 uri.append(u'?') 90 uri.append(u'?')
91 addPairs(uri, kwargs) 91 addPairs(uri, kwargs)
92 else: 92 else: