From 691b881fdc7db0137e395e9a7dc49f7bba41632b Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 17 Dec 2015 22:10:53 +0100 Subject: [PATCH] plugin XEP-0260: kill s5b session if session is declined --- src/plugins/plugin_xep_0260.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/plugin_xep_0260.py b/src/plugins/plugin_xep_0260.py index 49e2117d..b5826b0a 100644 --- a/src/plugins/plugin_xep_0260.py +++ b/src/plugins/plugin_xep_0260.py @@ -392,6 +392,15 @@ class XEP_0260(object): defer.returnValue(transport_elt) + def jingleTerminate(self, action, session, content_name, reason_elt, profile): + if reason_elt.decline: + log.debug(u"Session declined, deleting S5B session") + # we just need to clean the S5B session if it is declined + client = self.host.getClient(profile) + content_data = session['contents'][content_name] + transport_data = content_data['transport_data'] + self._s5b.killSession(None, transport_data['session_hash'], None, client) + def _doFallback(self, feature_checked, session, content_name, client): """Do the fallback, method called once feature is checked