changeset 1629:a34d7f621944

plugin XEP-0065: renamed _killSession to killSession as it make sense to kill a session from an other plugin
author Goffi <goffi@goffi.org>
date Thu, 19 Nov 2015 18:15:35 +0100
parents e9936fcfaf91
children c25f63215632
files src/plugins/plugin_xep_0065.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0065.py	Thu Nov 19 18:15:27 2015 +0100
+++ b/src/plugins/plugin_xep_0065.py	Thu Nov 19 18:15:35 2015 +0100
@@ -849,7 +849,6 @@
 
         # should be already sorted, but just in case the priorities get weird
         candidates.sort(key=lambda c: c.priority, reverse=True)
-
         defer.returnValue(candidates)
 
     def _addConnector(self, connector, candidate):
@@ -950,7 +949,7 @@
         session = self.getSession(session_hash, client.profile)
         session[DEFER_KEY].errback(exceptions.TimeOutError)
 
-    def _killSession(self, reason, session_hash, sid, client):
+    def killSession(self, reason, session_hash, sid, client):
         """Clean the current session
 
         @param session_hash(str): hash as returned by getSessionHash
@@ -1103,7 +1102,7 @@
         else:
             session_hash = getSessionHash(to_jid, client.jid, sid)
             session_d = defer.Deferred()
-            session_d.addBoth(self._killSession, session_hash, sid, client)
+            session_d.addBoth(self.killSession, session_hash, sid, client)
             session_data = client._s5b_sessions[session_hash] = {
                 DEFER_KEY: session_d,
                 TIMER_KEY: reactor.callLater(TIMEOUT, self._timeOut, session_hash, client),
@@ -1156,7 +1155,7 @@
         client = self.host.getClient(profile)
         assert session_hash not in client._s5b_sessions
         session_d = defer.Deferred()
-        session_d.addBoth(self._killSession, session_hash, None, client)
+        session_d.addBoth(self.killSession, session_hash, None, client)
         session_data = client._s5b_sessions[session_hash] = {
             "file": file_obj,
             DEFER_KEY: session_d,