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:
lilia 2015-08-05 16:06:28 -07:00
parent 82431c3c12
commit 4f1ce4c493
2 changed files with 2 additions and 2 deletions

View file

@ -40007,7 +40007,7 @@ window.textsecure.messaging = function() {
})).then(function() {
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
if (devicesForNumber.length == 0) {
getKeysForNumber(number)
getKeysForNumber(number, [1])
.then(reloadDevicesAndSend(number, true))
.catch(function(error) {
registerError(number, "Failed to retreive new device keys for number " + number, error);

View file

@ -244,7 +244,7 @@ window.textsecure.messaging = function() {
})).then(function() {
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devicesForNumber) {
if (devicesForNumber.length == 0) {
getKeysForNumber(number)
getKeysForNumber(number, [1])
.then(reloadDevicesAndSend(number, true))
.catch(function(error) {
registerError(number, "Failed to retreive new device keys for number " + number, error);