Don't allow retry on unregistered user errors
// FREEBIE
This commit is contained in:
parent
292260d973
commit
81dfdd959f
2 changed files with 4 additions and 4 deletions
|
@ -38514,7 +38514,7 @@ OutgoingMessage.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
registerError: function(number, reason, error) {
|
registerError: function(number, reason, error) {
|
||||||
if (!error || error.name === 'HTTPError') {
|
if (!error || error.name === 'HTTPError' && error.code !== 404) {
|
||||||
error = new textsecure.OutgoingMessageError(number, this.message.toArrayBuffer(), this.timestamp, error);
|
error = new textsecure.OutgoingMessageError(number, this.message.toArrayBuffer(), this.timestamp, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38570,7 +38570,7 @@ OutgoingMessage.prototype = {
|
||||||
|
|
||||||
transmitMessage: function(number, jsonData, timestamp) {
|
transmitMessage: function(number, jsonData, timestamp) {
|
||||||
return this.server.sendMessages(number, jsonData, timestamp).catch(function(e) {
|
return this.server.sendMessages(number, jsonData, timestamp).catch(function(e) {
|
||||||
if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410)) {
|
if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410 && e.code !== 404)) {
|
||||||
// 409 and 410 should bubble and be handled by doSendMessage
|
// 409 and 410 should bubble and be handled by doSendMessage
|
||||||
// all other network errors can be retried later.
|
// all other network errors can be retried later.
|
||||||
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);
|
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);
|
||||||
|
|
|
@ -23,7 +23,7 @@ OutgoingMessage.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
registerError: function(number, reason, error) {
|
registerError: function(number, reason, error) {
|
||||||
if (!error || error.name === 'HTTPError') {
|
if (!error || error.name === 'HTTPError' && error.code !== 404) {
|
||||||
error = new textsecure.OutgoingMessageError(number, this.message.toArrayBuffer(), this.timestamp, error);
|
error = new textsecure.OutgoingMessageError(number, this.message.toArrayBuffer(), this.timestamp, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ OutgoingMessage.prototype = {
|
||||||
|
|
||||||
transmitMessage: function(number, jsonData, timestamp) {
|
transmitMessage: function(number, jsonData, timestamp) {
|
||||||
return this.server.sendMessages(number, jsonData, timestamp).catch(function(e) {
|
return this.server.sendMessages(number, jsonData, timestamp).catch(function(e) {
|
||||||
if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410)) {
|
if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410 && e.code !== 404)) {
|
||||||
// 409 and 410 should bubble and be handled by doSendMessage
|
// 409 and 410 should bubble and be handled by doSendMessage
|
||||||
// all other network errors can be retried later.
|
// all other network errors can be retried later.
|
||||||
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);
|
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);
|
||||||
|
|
Loading…
Reference in a new issue