summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2021-07-17 02:06:01 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2021-07-17 02:52:43 +0200
commit00a91774fc93a6555120ed61946194d0499063bf (patch)
tree718c5fdaa9210492f679bdc3216e515611aa074e
parent90242b8243291a881883699d3f7006f64478daf9 (diff)
downloadpoezio-00a91774fc93a6555120ed61946194d0499063bf.tar.gz
poezio-00a91774fc93a6555120ed61946194d0499063bf.tar.bz2
poezio-00a91774fc93a6555120ed61946194d0499063bf.tar.xz
poezio-00a91774fc93a6555120ed61946194d0499063bf.zip
plugin_e2ee: correctly pass realjid to decrypt call in MUC
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_e2ee.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py
index c0c2b865..c35e9935 100644
--- a/poezio/plugin_e2ee.py
+++ b/poezio/plugin_e2ee.py
@@ -378,17 +378,18 @@ class E2EEPlugin(BasePlugin):
# fine with this so let them handle it.
jid = message['from']
- muctab = None
+ muctab: Optional[MucTab] = None
if isinstance(tab, PrivateTab):
muctab = tab.parent_muc
jid = None
- if isinstance(muctab, MucTab):
+ if muctab is not None or isinstance(tab, MucTab):
+ if muctab is None:
+ muctab = tab # type: ignore
nick = message['from'].resource
- for user in muctab.users:
- if user.nick == nick:
- jid = user.jid or None
- break
+ user = muctab.get_user_by_name(nick) # type: ignore
+ if user is not None:
+ jid = user.jid or None
self.decrypt(message, jid, tab)