diff 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
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0060.py	Thu Feb 25 16:05:31 2016 +0100
+++ b/src/plugins/plugin_xep_0060.py	Thu Feb 25 16:21:17 2016 +0100
@@ -410,10 +410,13 @@
         @param node(unicode): node
         @return (unicode): URI of the node
         """
+        # XXX: urllib.urlencode use "&" to separate value, while XMPP URL (cf. RFC 5122)
+        #      use ";" as a separator. So if more than one value is used in query_data,
+        #      urlencode MUST NOT BE USED.
         query_data = [('node', node.encode('utf-8'))]
         if item is not None:
             query_data.append(('item', item.encode('utf-8')))
-        return "xmpp:{service}?{query}".format(
+        return "xmpp:{service}?;{query}".format(
             service=service.userhost(),
             query=urllib.urlencode(query_data)
             ).decode('utf-8')