changeset 1461:8ac062d2ff8b

pages(lists/view_item): fix node used: since we are now using XEP-0346, we must use the prefixed nodes for the `xmpp:` URI and for the determining ownership.
author Goffi <goffi@goffi.org>
date Thu, 30 Sep 2021 11:43:44 +0200
parents 0ea54090e414
children 87e48b6a1bbd
files libervia/pages/lists/view_item/page_meta.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/pages/lists/view_item/page_meta.py	Wed Sep 29 17:39:37 2021 +0200
+++ b/libervia/pages/lists/view_item/page_meta.py	Thu Sep 30 11:43:44 2021 +0200
@@ -35,8 +35,10 @@
         data.get("node", ""),
         data["item_id"],
     )
+    namespace = node or self.host.ns_map["tickets"]
+    node = await self.host.bridgeCall("psSchemaSubmittedNodeGet", namespace)
+
     profile = self.getProfile(request)
-
     if profile is None:
         profile = C.SERVICE_PROFILE
 
@@ -90,7 +92,6 @@
         is_publisher = publisher.userhostJID() == session.jid.userhostJID()
         affiliation = None
         if not is_publisher:
-            node = node or self.host.ns_map["tickets"]
             affiliation = await self.host.getAffiliation(request, service, node)
         if is_publisher or affiliation == "owner":
             self.exposeToScripts(
@@ -109,7 +110,7 @@
 
     # we add xmpp: URI
     uri_args = {'path': service.full()}
-    uri_args['node'] = node or self.host.ns_map["tickets"]
+    uri_args['node'] = node
     if item_id:
         uri_args['item'] = item_id
     template_data['xmpp_uri'] = uri.buildXMPPUri('pubsub', **uri_args)