plugin OTR: ignore messages from sender without resource or from own jid

This commit is contained in:
Goffi 2019-03-01 12:13:55 +01:00
commit 6b0847d6aa

View file

@ -733,6 +733,10 @@ class OTR(object):
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: