diff --git a/sat/plugins/plugin_xep_0166/models.py b/sat/plugins/plugin_xep_0166/models.py index 8be3fb16..dff65b92 100644 --- a/sat/plugins/plugin_xep_0166/models.py +++ b/sat/plugins/plugin_xep_0166/models.py @@ -100,6 +100,10 @@ class BaseApplicationHandler(abc.ABC): @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 @@ class BaseTransportHandler(abc.ABC): 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 @@ class BaseTransportHandler(abc.ABC): @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 --git a/sat/plugins/plugin_xep_0176.py b/sat/plugins/plugin_xep_0176.py index cde62a2a..643f7928 100644 --- a/sat/plugins/plugin_xep_0176.py +++ b/sat/plugins/plugin_xep_0176.py @@ -290,7 +290,14 @@ class XEP_0176(BaseTransportHandler): 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 --git a/sat/plugins/plugin_xep_0234.py b/sat/plugins/plugin_xep_0234.py index 4da000c6..2917b07c 100644 --- a/sat/plugins/plugin_xep_0234.py +++ b/sat/plugins/plugin_xep_0234.py @@ -697,20 +697,20 @@ class XEP_0234: 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(