From 80cdab3ba3fcc1eb268bdce12ec3228ae5f650e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 15 Dec 2021 22:56:58 +0100 Subject: [PATCH] is_encrypted doesn't require the plugin to be instanciated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp_omemo/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 5a9f553..f7320cb 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -659,7 +659,8 @@ class XEP_0384(BasePlugin): 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 async def decrypt_message(