plugin XEP-0176: fix candidates data format when calling Bridge's ice_candidates_new

This commit is contained in:
Goffi 2023-05-29 13:32:32 +02:00
commit 391112a059

View file

@ -159,7 +159,7 @@ class XEP_0176(BaseTransportHandler):
"""Parse <transport> to a dict
@param transport_elt: <transport> element
@return: ICE data (as in [build_description])
@return: ICE data (as in [build_transport])
"""
try:
ice_data = {
@ -269,6 +269,8 @@ class XEP_0176(BaseTransportHandler):
# responder side, we give our candidates
transport_elt = self.build_transport(transport_data["local_ice_data"])
elif action == self._j.A_TRANSPORT_INFO:
media_type = content_data["application_data"].get("media")
new_ice_data = self.parse_transport(transport_elt)
restart = self.update_candidates(transport_data, new_ice_data, local=False)
if restart:
@ -280,7 +282,7 @@ class XEP_0176(BaseTransportHandler):
self.host.bridge.ice_candidates_new(
session["id"],
data_format.serialise(new_ice_data["candidates"]),
data_format.serialise({media_type: new_ice_data}),
client.profile
)
elif action == self._j.A_DESTROY: