comparison libervia/backend/plugins/plugin_xep_0176.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents e11b13418ba6
children 29fda1340078
comparison
equal deleted inserted replaced
4269:64a85ce8be70 4270:0d7bb4df2343
289 client, 289 client,
290 session, 290 session,
291 content_name, 291 content_name,
292 content_data, 292 content_data,
293 transport_elt, 293 transport_elt,
294 iq_elt 294 iq_elt,
295 ) 295 )
296 await iq_elt.send() 296 await iq_elt.send()
297 297
298 elif action == self._j.A_START: 298 elif action == self._j.A_START:
299 pass 299 pass
379 @param media_ice_data: a map from media type (audio, video) to ICE data 379 @param media_ice_data: a map from media type (audio, video) to ICE data
380 ICE data must be in the same format as in [self.parse_transport] 380 ICE data must be in the same format as in [self.parse_transport]
381 """ 381 """
382 session = self._j.get_session(client, session_id) 382 session = self._j.get_session(client, session_id)
383 iq_elt: Optional[domish.Element] = None 383 iq_elt: Optional[domish.Element] = None
384 content_name: str|None = None 384 content_name: str | None = None
385 content_data: dict|None = None 385 content_data: dict | None = None
386 386
387 for media_type, new_ice_data in media_ice_data.items(): 387 for media_type, new_ice_data in media_ice_data.items():
388 if session["state"] == self._j.STATE_PENDING: 388 if session["state"] == self._j.STATE_PENDING:
389 log.debug(f"session not active, buffering") 389 log.debug(f"session not active, buffering")
390 buffer = session.setdefault("XEP-0176_buffer", {}) 390 buffer = session.setdefault("XEP-0176_buffer", {})
434 434
435 if iq_elt is not None: 435 if iq_elt is not None:
436 assert content_name is not None and content_data is not None 436 assert content_name is not None and content_data is not None
437 try: 437 try:
438 self.host.trigger.point( 438 self.host.trigger.point(
439 "XEP-0176_ice_candidate_send", client, session, media_ice_data, 439 "XEP-0176_ice_candidate_send",
440 content_name, content_data, iq_elt 440 client,
441 session,
442 media_ice_data,
443 content_name,
444 content_data,
445 iq_elt,
441 ) 446 )
442 await iq_elt.send() 447 await iq_elt.send()
443 except Exception as e: 448 except Exception as e:
444 log.warning(f"Could not send new ICE candidates: {e}") 449 log.warning(f"Could not send new ICE candidates: {e}")
445 450