# HG changeset patch
# User Goffi <goffi@goffi.org>
# Date 1534004695 -7200
# Node ID c26492bd21442d56bfabe6c58f9103b891588741
# Parent  4e130cc9bfc0142e3ca90584679a384531b4da65
plugin OTR: use new "directed" attribute when registering + use new markAsEncrypted

diff -r 4e130cc9bfc0 -r c26492bd2144 sat/plugins/plugin_sec_otr.py
--- 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):