Sort sender key devices for future optimization
This commit is contained in:
parent
75f0cd50be
commit
784e5d5eee
1 changed files with 14 additions and 3 deletions
|
@ -841,9 +841,20 @@ async function encryptForSenderKey({
|
|||
groupIdBuffer
|
||||
);
|
||||
|
||||
const recipients = devices.map(device =>
|
||||
ProtocolAddress.new(device.identifier, device.id)
|
||||
);
|
||||
const recipients = devices
|
||||
.slice()
|
||||
.sort((a, b): number => {
|
||||
if (a.identifier === b.identifier) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (a.identifier < b.identifier) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
})
|
||||
.map(device => ProtocolAddress.new(device.identifier, device.id));
|
||||
const identityKeyStore = new IdentityKeys();
|
||||
const sessionStore = new Sessions();
|
||||
return sealedSenderMultiRecipientEncrypt(
|
||||
|
|
Loading…
Add table
Reference in a new issue