plugin OTR: use new "directed" attribute when registering + use new markAsEncrypted

This commit is contained in:
Goffi 2018-08-11 18:24:55 +02:00
commit e18036d2fb

View file

@ -260,6 +260,7 @@ class ContextManager(object):
class OTR(object):
def __init__(self, host):
log.info(_(u"OTR plugin initialization"))
self.host = host
@ -306,7 +307,7 @@ class OTR(object):
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 @@ class OTR(object):
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):