is_encrypted doesn't require the plugin to be instanciated

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-12-15 22:56:58 +01:00
parent 8e44c07aed
commit 80cdab3ba3

View file

@ -659,7 +659,8 @@ class XEP_0384(BasePlugin):
return await self._omemo().getTrustForJID(jid.bare) return await self._omemo().getTrustForJID(jid.bare)
def is_encrypted(self, msg: Message) -> bool: @classmethod
def is_encrypted(cls, msg: Message) -> bool:
return msg.xml.find('{%s}encrypted' % OMEMO_BASE_NS) is not None return msg.xml.find('{%s}encrypted' % OMEMO_BASE_NS) is not None
async def decrypt_message( async def decrypt_message(