comparison src/plugins/plugin_xep_0060.py @ 1854:3c0bb714a80b

plugin XEP-0060: fixed bad xmpp: URI generation in getNodeURI
author Goffi <goffi@goffi.org>
date Thu, 25 Feb 2016 16:21:17 +0100
parents 6079752ffeae
children fc6eeacf31bc
comparison
equal deleted inserted replaced
1853:1a9c12644552 1854:3c0bb714a80b
408 408
409 @param service(jid.JID, None): PubSub service, 409 @param service(jid.JID, None): PubSub service,
410 @param node(unicode): node 410 @param node(unicode): node
411 @return (unicode): URI of the node 411 @return (unicode): URI of the node
412 """ 412 """
413 # XXX: urllib.urlencode use "&" to separate value, while XMPP URL (cf. RFC 5122)
414 # use ";" as a separator. So if more than one value is used in query_data,
415 # urlencode MUST NOT BE USED.
413 query_data = [('node', node.encode('utf-8'))] 416 query_data = [('node', node.encode('utf-8'))]
414 if item is not None: 417 if item is not None:
415 query_data.append(('item', item.encode('utf-8'))) 418 query_data.append(('item', item.encode('utf-8')))
416 return "xmpp:{service}?{query}".format( 419 return "xmpp:{service}?;{query}".format(
417 service=service.userhost(), 420 service=service.userhost(),
418 query=urllib.urlencode(query_data) 421 query=urllib.urlencode(query_data)
419 ).decode('utf-8') 422 ).decode('utf-8')
420 423
421 ## methods to manage several stanzas/jids at once ## 424 ## methods to manage several stanzas/jids at once ##