Throw UnregisteredUserErrors in getKeysForNumber()
This commit is contained in:
parent
e8de2f0c52
commit
d2ddfc72e4
2 changed files with 6 additions and 4 deletions
|
@ -38640,8 +38640,9 @@ OutgoingMessage.prototype = {
|
||||||
updateDevices.forEach(function(device) {
|
updateDevices.forEach(function(device) {
|
||||||
promise = promise.then(function() {
|
promise = promise.then(function() {
|
||||||
return this.server.getKeysForNumber(number, device).then(handleResult).catch(function(e) {
|
return this.server.getKeysForNumber(number, device).then(handleResult).catch(function(e) {
|
||||||
if (e.name === 'HTTPError' && e.code === 404 && device !== 1) {
|
if (e.name === 'HTTPError' && e.code === 404) {
|
||||||
return this.removeDeviceIdsForNumber(number, [device]);
|
if (device !== 1) return this.removeDeviceIdsForNumber(number, [device]);
|
||||||
|
else throw new textsecure.UnregisteredUserError(number, e);
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,9 @@ OutgoingMessage.prototype = {
|
||||||
updateDevices.forEach(function(device) {
|
updateDevices.forEach(function(device) {
|
||||||
promise = promise.then(function() {
|
promise = promise.then(function() {
|
||||||
return this.server.getKeysForNumber(number, device).then(handleResult).catch(function(e) {
|
return this.server.getKeysForNumber(number, device).then(handleResult).catch(function(e) {
|
||||||
if (e.name === 'HTTPError' && e.code === 404 && device !== 1) {
|
if (e.name === 'HTTPError' && e.code === 404) {
|
||||||
return this.removeDeviceIdsForNumber(number, [device]);
|
if (device !== 1) return this.removeDeviceIdsForNumber(number, [device]);
|
||||||
|
else throw new textsecure.UnregisteredUserError(number, e);
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue