changeset 4122:52a89ddf3087

plugin XEP-0338: be sure to add the `<group>` element only once: rel 424
author Goffi <goffi@goffi.org>
date Tue, 03 Oct 2023 15:27:07 +0200
parents b2709504586a
children c8b19a32f5c0
files libervia/backend/plugins/plugin_xep_0338.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0338.py	Tue Oct 03 15:25:52 2023 +0200
+++ b/libervia/backend/plugins/plugin_xep_0338.py	Tue Oct 03 15:27:07 2023 +0200
@@ -124,8 +124,11 @@
         media_data: dict,
         desc_elt: domish.Element,
     ) -> None:
-        jingle_elt = session["jingle_elt"]
-        self.add_group_element(jingle_elt, session)
+        if content_name == next(iter(session["contents"])):
+            # the <group> element must be added only once, so we do it only for the first
+            # content
+            jingle_elt = session["jingle_elt"]
+            self.add_group_element(jingle_elt, session)
 
     def _jingle_handler_trigger(
         self,