# HG changeset patch # User Goffi # Date 1634921211 -7200 # Node ID 52ee22d78e1858a7d63c50ad3d7ea5e609a337f0 # Parent 87caf6284c55f3305510f7a0dba3c8f017c842c9 plugin XEP-0384: fix encryption for user own devices: our own jid is added automatically by OMEMO library, but during the generation of the stanza, our list of jids was used to get the keys (and thus our own jid and devices keys was missing). fix 402 diff -r 87caf6284c55 -r 52ee22d78e18 sat/plugins/plugin_xep_0384.py --- a/sat/plugins/plugin_xep_0384.py Fri Oct 22 10:40:24 2021 +0200 +++ b/sat/plugins/plugin_xep_0384.py Fri Oct 22 18:46:51 2021 +0200 @@ -1424,13 +1424,12 @@ header_elt = encrypted_elt.addElement('header') header_elt['sid'] = str(encryption_data['sid']) - for to_jid in to_jids: - bare_jid_s = to_jid.userhost() - - for rid, data in encryption_data['keys'][bare_jid_s].items(): + for key_data in encryption_data['keys'].values(): + for rid, data in key_data.items(): key_elt = header_elt.addElement( 'key', - content=b64enc(data['data'])) + content=b64enc(data['data']) + ) key_elt['rid'] = str(rid) if data['pre_key']: key_elt['prekey'] = 'true'