mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 10:28:03 +01:00
Check for device keys in memory before requesting more
// FREEBIE
This commit is contained in:
@@ -116,8 +116,8 @@ OutgoingMessage.prototype = {
|
||||
sendToNumber: function(number) {
|
||||
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
|
||||
return Promise.all(devicesForNumber.map(function(device) {
|
||||
return textsecure.protocol_wrapper.hasOpenSession(device.encodedNumber).then(function(result) {
|
||||
if (!result) {
|
||||
return textsecure.storage.devices.needKeysForDevice(device.encodedNumber).then(function(result) {
|
||||
if (result) {
|
||||
return this.getKeysForNumber(number,
|
||||
[parseInt(textsecure.utils.unencodeNumber(device.encodedNumber)[1])]
|
||||
).catch(function(error) {
|
||||
|
||||
Reference in New Issue
Block a user