Workaround poezio 00a91774; get realjids for MUC

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-07-17 03:00:26 +02:00
parent 20d0851294
commit 1e13ffa0bd
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -114,6 +114,15 @@ class Plugin(E2EEPlugin):
self.display_error('Unable to decrypt the message.') self.display_error('Unable to decrypt the message.')
return None 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 body = None
try: try:
encrypted = message['omemo_encrypted'] encrypted = message['omemo_encrypted']