Don't allow retry on unregistered user errors

// FREEBIE
This commit is contained in:
lilia 2016-05-24 11:36:04 -07:00
parent 292260d973
commit 81dfdd959f
2 changed files with 4 additions and 4 deletions

View file

@ -38514,7 +38514,7 @@ OutgoingMessage.prototype = {
}
},
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);
}
@ -38570,7 +38570,7 @@ OutgoingMessage.prototype = {
transmitMessage: function(number, jsonData, timestamp) {
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
// all other network errors can be retried later.
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);

View file

@ -23,7 +23,7 @@ OutgoingMessage.prototype = {
}
},
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);
}
@ -79,7 +79,7 @@ OutgoingMessage.prototype = {
transmitMessage: function(number, jsonData, timestamp) {
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
// all other network errors can be retried later.
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);