# HG changeset patch # User Goffi # Date 1551438835 -3600 # Node ID 3d735e0ab2fa5dba6dab1c8d866712bc43772f69 # Parent 7ab8684784c66de37680479700e5761b49bdcbd3 plugin OTR: ignore messages from sender without resource or from own jid diff -r 7ab8684784c6 -r 3d735e0ab2fa sat/plugins/plugin_sec_otr.py --- a/sat/plugins/plugin_sec_otr.py Fri Mar 01 12:12:50 2019 +0100 +++ b/sat/plugins/plugin_sec_otr.py Fri Mar 01 12:13:55 2019 +0100 @@ -733,6 +733,10 @@ if message_elt.getAttribute("type") == C.MESS_TYPE_GROUPCHAT: # OTR is not possible in group chats return True + from_jid = jid.JID(message_elt['from']) + if not from_jid.resource or from_jid.userhostJID() == client.jid.userhostJID(): + # OTR is only usable when resources are present + return True if client.profile in self.skipped_profiles: post_treat.addCallback(self._receivedTreatmentForSkippedProfiles) else: