Assume unknown recipients are single-device
Start by requesting keys for only the master device, then handle 410 as needed. Single-device users are the more common case and this strategy lets us avoid requesting/expending one of our own device keys when establishing a session with sibling devices. // FREEBIE
This commit is contained in:
@@ -40007,7 +40007,7 @@ window.textsecure.messaging = function() {
|
|||||||
})).then(function() {
|
})).then(function() {
|
||||||
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
|
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
|
||||||
if (devicesForNumber.length == 0) {
|
if (devicesForNumber.length == 0) {
|
||||||
getKeysForNumber(number)
|
getKeysForNumber(number, [1])
|
||||||
.then(reloadDevicesAndSend(number, true))
|
.then(reloadDevicesAndSend(number, true))
|
||||||
.catch(function(error) {
|
.catch(function(error) {
|
||||||
registerError(number, "Failed to retreive new device keys for number " + number, error);
|
registerError(number, "Failed to retreive new device keys for number " + number, error);
|
||||||
|
@@ -244,7 +244,7 @@ window.textsecure.messaging = function() {
|
|||||||
})).then(function() {
|
})).then(function() {
|
||||||
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
|
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
|
||||||
if (devicesForNumber.length == 0) {
|
if (devicesForNumber.length == 0) {
|
||||||
getKeysForNumber(number)
|
getKeysForNumber(number, [1])
|
||||||
.then(reloadDevicesAndSend(number, true))
|
.then(reloadDevicesAndSend(number, true))
|
||||||
.catch(function(error) {
|
.catch(function(error) {
|
||||||
registerError(number, "Failed to retreive new device keys for number " + number, error);
|
registerError(number, "Failed to retreive new device keys for number " + number, error);
|
||||||
|
Reference in New Issue
Block a user