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:
parent
82431c3c12
commit
4f1ce4c493
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue