Mercurial > libervia-backend
changeset 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 | 1a9c12644552 |
children | 1c9b2c184663 |
files | src/plugins/plugin_xep_0060.py src/plugins/plugin_xep_0277.py |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
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')
--- a/src/plugins/plugin_xep_0277.py Thu Feb 25 16:05:31 2016 +0100 +++ b/src/plugins/plugin_xep_0277.py Thu Feb 25 16:21:17 2016 +0100 @@ -611,7 +611,7 @@ Determine the fields comments_service and comments_node of a microblog data from the href attribute of an entry's link element. For example this input: - xmpp:sat-pubsub.libervia.org?node=urn%3Axmpp%3Acomments%3A_c5c4a142-2279-4b2a-ba4c-1bc33aa87634__urn%3Axmpp%3Agroupblog%3Asouliane%40libervia.org + xmpp:sat-pubsub.libervia.org?;node=urn%3Axmpp%3Acomments%3A_c5c4a142-2279-4b2a-ba4c-1bc33aa87634__urn%3Axmpp%3Agroupblog%3Asouliane%40libervia.org will return (JID(u'sat-pubsub.libervia.org'), 'urn:xmpp:comments:_c5c4a142-2279-4b2a-ba4c-1bc33aa87634__urn:xmpp:groupblog:souliane@libervia.org') @return: a tuple (JID, str) """