# HG changeset patch # User Goffi # Date 1685359939 -7200 # Node ID 2ced30f6d5de68a52425c801ccc011c7b8b2e220 # Parent c23cad65ae99ee2981b3b839c36ab0ceb119b737 plugin XEP-0166, 0176, 0234: minor renaming + type hints diff -r c23cad65ae99 -r 2ced30f6d5de sat/plugins/plugin_xep_0166/models.py --- a/sat/plugins/plugin_xep_0166/models.py Mon May 29 13:32:08 2023 +0200 +++ b/sat/plugins/plugin_xep_0166/models.py Mon May 29 13:32:19 2023 +0200 @@ -100,6 +100,10 @@ @abc.abstractmethod def jingle_terminate( self, + client: SatXMPPEntity, + action: str, + session: dict, + content_name: str, reason_elt: domish.Element ) -> Union[ Callable[..., None], @@ -144,7 +148,7 @@ action: str, session: dict, content_name: str, - transport_elt: domish.Element + reason_elt: domish.Element ) -> Union[ Callable[..., None], Callable[..., Awaitable[None]] @@ -156,7 +160,7 @@ @param action: Jingle action @param session: Jingle Session @param content_name: Name of the content - @param transport_elt: Transport element + @param reason_elt: element """ pass diff -r c23cad65ae99 -r 2ced30f6d5de sat/plugins/plugin_xep_0176.py --- a/sat/plugins/plugin_xep_0176.py Mon May 29 13:32:08 2023 +0200 +++ b/sat/plugins/plugin_xep_0176.py Mon May 29 13:32:19 2023 +0200 @@ -290,7 +290,14 @@ return transport_elt - def jingle_terminate(self, client, action, session, content_name, reason_elt): + def jingle_terminate( + self, + client: SatXMPPEntity, + action: str, + session: dict, + content_name: str, + reason_elt: domish.Element, + ) -> None: log.debug("ICE-UDP session terminated") def update_candidates( diff -r c23cad65ae99 -r 2ced30f6d5de sat/plugins/plugin_xep_0234.py --- a/sat/plugins/plugin_xep_0234.py Mon May 29 13:32:08 2023 +0200 +++ b/sat/plugins/plugin_xep_0234.py Mon May 29 13:32:19 2023 +0200 @@ -697,20 +697,20 @@ else: raise NotImplementedError - def jingle_terminate(self, client, action, session, content_name, jingle_elt): - if jingle_elt.decline: + def jingle_terminate(self, client, action, session, content_name, reason_elt): + if reason_elt.decline: # progress is the only way to tell to frontends that session has been declined progress_id = self.get_progress_id(session, content_name) self.host.bridge.progress_error( progress_id, C.PROGRESS_ERROR_DECLINED, client.profile ) - elif not jingle_elt.success: + elif not reason_elt.success: progress_id = self.get_progress_id(session, content_name) - first_child = jingle_elt.firstChildElement() + first_child = reason_elt.firstChildElement() if first_child is not None: reason = first_child.name - if jingle_elt.text is not None: - reason = f"{reason} - {jingle_elt.text}" + if reason_elt.text is not None: + reason = f"{reason} - {reason_elt.text}" else: reason = C.PROGRESS_ERROR_FAILED self.host.bridge.progress_error(