Fix 410 handling

We need to close the existing session with an old registrationId.
This commit is contained in:
lilia 2015-06-04 11:55:35 -07:00
parent 7d08e1132d
commit a9549e2e0f
2 changed files with 6 additions and 2 deletions

View file

@ -39721,7 +39721,9 @@ window.textsecure.messaging = function() {
if (error.message == 409) {
p = textsecure.storage.devices.removeDeviceIdsForNumber(number, error.response.extraDevices);
} else {
p = Promise.resolve();
p = Promise.all(error.response.staleDevices.map(function(deviceId) {
return textsecure.protocol_wrapper.closeOpenSessionForDevice(number + '.' + deviceId);
}));
}
p.then(function() {

View file

@ -196,7 +196,9 @@ window.textsecure.messaging = function() {
if (error.message == 409) {
p = textsecure.storage.devices.removeDeviceIdsForNumber(number, error.response.extraDevices);
} else {
p = Promise.resolve();
p = Promise.all(error.response.staleDevices.map(function(deviceId) {
return textsecure.protocol_wrapper.closeOpenSessionForDevice(number + '.' + deviceId);
}));
}
p.then(function() {