comparison libervia/backend/plugins/plugin_xep_0167/__init__.py @ 4120:832a7bdb3aea

plugin XEP-0167: don't override existing metadata when preparing confirmation: rel 424
author Goffi <goffi@goffi.org>
date Tue, 03 Oct 2023 15:20:00 +0200
parents ece304ec7077
children e11b13418ba6
comparison
equal deleted inserted replaced
4119:ece304ec7077 4120:832a7bdb3aea
511 async def jingle_handler(self, client, action, session, content_name, desc_elt): 511 async def jingle_handler(self, client, action, session, content_name, desc_elt):
512 content_data = session["contents"][content_name] 512 content_data = session["contents"][content_name]
513 application_data = content_data["application_data"] 513 application_data = content_data["application_data"]
514 if action == self._j.A_PREPARE_CONFIRMATION: 514 if action == self._j.A_PREPARE_CONFIRMATION:
515 session["metadata"] = {} 515 session["metadata"] = {}
516 session["peer_metadata"] = {} 516 session.setdefault("peer_metadata", {})
517 try: 517 try:
518 media = application_data["media"] = desc_elt["media"] 518 media = application_data["media"] = desc_elt["media"]
519 except KeyError: 519 except KeyError:
520 raise exceptions.DataError('"media" key is missing in {desc_elt.toXml()}') 520 raise exceptions.DataError('"media" key is missing in {desc_elt.toXml()}')
521 if media not in ("audio", "video"): 521 if media not in ("audio", "video"):