diff src/pages/common/blog/page_meta.py @ 1038:6b906b1f419a

pages: fixed XMPP URIs handling
author Goffi <goffi@goffi.org>
date Wed, 24 Jan 2018 09:57:57 +0100
parents f5661761b1b9
children 6bc7768faa5d
line wrap: on
line diff
--- a/src/pages/common/blog/page_meta.py	Wed Jan 24 09:57:38 2018 +0100
+++ b/src/pages/common/blog/page_meta.py	Wed Jan 24 09:57:57 2018 +0100
@@ -10,7 +10,6 @@
 from sat.tools.common.template import safe
 from server import utils
 import re
-import urllib
 import cgi
 log = getLogger('pages/common/blog')
 
@@ -23,10 +22,10 @@
 TEXT_MAX_LEN = 60
 
 def microblog_uri(self, uri_data):
-    service = urllib.quote_plus(uri_data[u'path'])
-    node = urllib.quote_plus(uri_data[u'node'])
-    return service + u'/' + node
-
+    args = [uri_data[u'path'], uri_data[u'node']]
+    if u'item' in uri_data:
+        args.extend([u'id', uri_data[u'item']])
+    return self.getURL(*args)
 
 def parse_url(self, request):
     """URL is /[service]/[node]/[filter_keyword]/[item]|[other]