# HG changeset patch # User Goffi # Date 1612469121 -3600 # Node ID 6791103de47dbb784a6ba9af6fa6a96d24ae767d # Parent 6deea0d8d0e714e70429fa20074a2595d4c35688 plugin XEP-0346: use submitted namespace for node: the node was not always adapted to the submitted namespace now used with XEP-0346, this patch fixes it by adding the prefix when it's missing. diff -r 6deea0d8d0e7 -r 6791103de47d sat/plugins/plugin_xep_0346.py --- a/sat/plugins/plugin_xep_0346.py Thu Feb 04 21:05:21 2021 +0100 +++ b/sat/plugins/plugin_xep_0346.py Thu Feb 04 21:05:21 2021 +0100 @@ -112,9 +112,9 @@ namespace = namespace[len(TEMPLATE_PREFIX):] return namespace - def getSubmittedNS(self, app_ns: str) -> str: + def getSubmittedNS(self, namespace: str) -> str: """Returns node to use to submit forms""" - return f"{SUBMITTED_PREFIX}{app_ns}" + return f"{SUBMITTED_PREFIX}{self.getApplicationNS(namespace)}" def _getSchemaBridgeCb(self, schema_elt): if schema_elt is None: @@ -300,6 +300,7 @@ _("default_node must be set if nodeIdentifier is not set") ) nodeIdentifier = default_node + submitted_ns = self.getSubmittedNS(nodeIdentifier) # we need the initial form to get options of fields when suitable schema_form = await self.getSchemaForm( client, service, nodeIdentifier, schema, form_type="result", copy_form=False @@ -307,7 +308,7 @@ items_data = await self._p.getItems( client, service, - nodeIdentifier, + submitted_ns, max_items, item_ids, sub_id, @@ -659,6 +660,7 @@ if default_node is None: raise ValueError(_("default_node must be set if node is not set")) node = default_node + node = self.getSubmittedNS(node) now = utils.xmpp_date() if not item_id: values["created"] = now