From f251aa48fa72eac7690ae75fc4fa45969016eba2 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 3 Oct 2023 16:00:21 +0200 Subject: [PATCH] plugin XEP-0338: always add `` element as first child: this is to work around a Movim bug (https://github.com/movim/movim/issues/1233). rel 424 --- libervia/backend/plugins/plugin_xep_0338.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libervia/backend/plugins/plugin_xep_0338.py b/libervia/backend/plugins/plugin_xep_0338.py index c0604072..7afe3274 100644 --- a/libervia/backend/plugins/plugin_xep_0338.py +++ b/libervia/backend/plugins/plugin_xep_0338.py @@ -109,7 +109,11 @@ class XEP_0338: ) -> None: """Build the and elements if possible""" for semantics, content_names in session["metadata"].get("group", {}).items(): - group_elt = jingle_elt.addElement((NS_JINGLE_GROUPING, "group")) + # always add the element as first child of element to work + # around https://github.com/movim/movim/issues/1233 + group_elt = domish.Element((NS_JINGLE_GROUPING, "group")) + jingle_elt.children.insert(0, group_elt) + group_elt["semantics"] = semantics for content_name in content_names: content_elt = group_elt.addElement((NS_JINGLE_GROUPING, "content"))