comparison sat/plugins/plugin_xep_0384.py @ 3709:09f5ac48ffe3

merge bookmark @
author Goffi <goffi@goffi.org>
date Fri, 12 Nov 2021 17:21:24 +0100
parents e4054b648111 52ee22d78e18
children 11f7ca8afd15
comparison
equal deleted inserted replaced
3684:8353cc3b8db9 3709:09f5ac48ffe3
1426 1426
1427 encrypted_elt = message_elt.addElement((NS_OMEMO, 'encrypted')) 1427 encrypted_elt = message_elt.addElement((NS_OMEMO, 'encrypted'))
1428 header_elt = encrypted_elt.addElement('header') 1428 header_elt = encrypted_elt.addElement('header')
1429 header_elt['sid'] = str(encryption_data['sid']) 1429 header_elt['sid'] = str(encryption_data['sid'])
1430 1430
1431 for to_jid in to_jids: 1431 for key_data in encryption_data['keys'].values():
1432 bare_jid_s = to_jid.userhost() 1432 for rid, data in key_data.items():
1433
1434 for rid, data in encryption_data['keys'][bare_jid_s].items():
1435 key_elt = header_elt.addElement( 1433 key_elt = header_elt.addElement(
1436 'key', 1434 'key',
1437 content=b64enc(data['data'])) 1435 content=b64enc(data['data'])
1436 )
1438 key_elt['rid'] = str(rid) 1437 key_elt['rid'] = str(rid)
1439 if data['pre_key']: 1438 if data['pre_key']:
1440 key_elt['prekey'] = 'true' 1439 key_elt['prekey'] = 'true'
1441 1440
1442 header_elt.addElement( 1441 header_elt.addElement(