diff --git a/sat/plugins/plugin_xep_0384.py b/sat/plugins/plugin_xep_0384.py index 85e11ad2..74545dd6 100644 --- a/sat/plugins/plugin_xep_0384.py +++ b/sat/plugins/plugin_xep_0384.py @@ -1424,13 +1424,12 @@ class OMEMO: 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'