changeset 2659:c26492bd2144

plugin OTR: use new "directed" attribute when registering + use new markAsEncrypted
author Goffi <goffi@goffi.org>
date Sat, 11 Aug 2018 18:24:55 +0200
parents 4e130cc9bfc0
children 2901e22d1766
files sat/plugins/plugin_sec_otr.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_sec_otr.py	Sat Aug 11 18:24:55 2018 +0200
+++ b/sat/plugins/plugin_sec_otr.py	Sat Aug 11 18:24:55 2018 +0200
@@ -260,6 +260,7 @@
 
 
 class OTR(object):
+
     def __init__(self, host):
         log.info(_(u"OTR plugin initialization"))
         self.host = host
@@ -306,7 +307,7 @@
             type_=C.MENU_SINGLE,
         )
         host.trigger.add("presenceReceived", self._presenceReceivedTrigger)
-        self.host.registerEncryptionPlugin(self, u"OTR", NS_OTR)
+        self.host.registerEncryptionPlugin(self, u"OTR", NS_OTR, directed=True)
 
     def _skipOTR(self, profile):
         """Tell the backend to not handle OTR for this profile.
@@ -621,6 +622,7 @@
                 raise failure.Failure(
                     exceptions.CancelError("Cancelled by OTR")
                 )  # no message at all (no history, no signal)
+        client.encryption.markAsEncrypted(data)
         return data
 
     def _receivedTreatmentForSkippedProfiles(self, data):