Fix 410 handling

We need to close the existing session with an old registrationId.
pull/749/head
lilia 10 years ago
parent 7d08e1132d
commit a9549e2e0f

@ -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() {

@ -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() {

Loading…
Cancel
Save