changeset 4123:c8b19a32f5c0

plugin XEP-0338: always add `<group>` element as first <jingle> child: this is to work around a Movim bug (https://github.com/movim/movim/issues/1233). rel 424
author Goffi <goffi@goffi.org>
date Tue, 03 Oct 2023 16:00:21 +0200
parents 52a89ddf3087
children 6b581d4c249f
files libervia/backend/plugins/plugin_xep_0338.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0338.py	Tue Oct 03 15:27:07 2023 +0200
+++ b/libervia/backend/plugins/plugin_xep_0338.py	Tue Oct 03 16:00:21 2023 +0200
@@ -109,7 +109,11 @@
     ) -> None:
         """Build the <group> and <content> 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 <group> element as first child of <jingle> 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"))