From 1e13ffa0bd262317f2eeb219b90f2431b3ed014c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 17 Jul 2021 03:00:26 +0200 Subject: [PATCH] Workaround poezio 00a91774; get realjids for MUC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio_omemo/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/poezio_omemo/__init__.py b/poezio_omemo/__init__.py index c46a6d3..7a4ebc9 100644 --- a/poezio_omemo/__init__.py +++ b/poezio_omemo/__init__.py @@ -114,6 +114,15 @@ class Plugin(E2EEPlugin): self.display_error('Unable to decrypt the message.') return None + # XXX: This is only needed to workaround a bug in poezio (fixed in + # 00a91774) that makes it not give us realjids. Remove when there is a + # poezio release including it. + # The realjid of the participant needs to be retrieved in a MUC. + if isinstance(tab, MucTab): + user = tab.get_user_by_name(jid.resource) + if user is not None and user.jid != JID(''): + jid = user.jid + body = None try: encrypted = message['omemo_encrypted']