diff src/browser/sat_browser/otrjs_wrapper.py @ 530:1735aaeac652

plugin OTR: forces FINISHED state if we are in ENCRYPTED state on contact disconnection
author souliane <souliane@mailoo.org>
date Fri, 05 Sep 2014 11:53:55 +0200
parents 5add182e7dd5
children 1fa173107fde
line wrap: on
line diff
--- a/src/browser/sat_browser/otrjs_wrapper.py	Fri Sep 05 11:41:40 2014 +0200
+++ b/src/browser/sat_browser/otrjs_wrapper.py	Fri Sep 05 11:53:55 2014 +0200
@@ -130,6 +130,10 @@
         def disconnect(self):
             self.otr.endOtr()
 
+        def finish(self):
+            """Finish the session - avoid to send any message and the user has to manually disconnect"""
+            self.otr.handleTLVs('\x00\x00\x01\x00\x00')
+
         def receiveMessage(self, msg):
             """Received a message, ask otr.js to (try to) decrypt it"""
             self.otr.receiveMsg(msg)