Save message timestamp for resending
Fix bug where resending due to failed network connection would fail silently. Broken in 7b6820 refactor which changed arguments to transmitMessage // FREEBIE
This commit is contained in:
parent
5d15069f8a
commit
b00d5289cf
3 changed files with 6 additions and 6 deletions
|
@ -74,10 +74,10 @@
|
|||
OutgoingMessageError.prototype = new ReplayableError();
|
||||
OutgoingMessageError.prototype.constructor = OutgoingMessageError;
|
||||
|
||||
function SendMessageNetworkError(number, jsonData, httpError) {
|
||||
function SendMessageNetworkError(number, jsonData, httpError, timestamp) {
|
||||
ReplayableError.call(this, {
|
||||
functionCode : Type.TRANSMIT_MESSAGE,
|
||||
args : [number, jsonData]
|
||||
args : [number, jsonData, timestamp]
|
||||
});
|
||||
this.name = 'SendMessageNetworkError';
|
||||
this.number = number;
|
||||
|
@ -37249,7 +37249,7 @@ OutgoingMessage.prototype = {
|
|||
if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410)) {
|
||||
// 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);
|
||||
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);
|
||||
}
|
||||
throw e;
|
||||
});
|
||||
|
|
|
@ -73,10 +73,10 @@
|
|||
OutgoingMessageError.prototype = new ReplayableError();
|
||||
OutgoingMessageError.prototype.constructor = OutgoingMessageError;
|
||||
|
||||
function SendMessageNetworkError(number, jsonData, httpError) {
|
||||
function SendMessageNetworkError(number, jsonData, httpError, timestamp) {
|
||||
ReplayableError.call(this, {
|
||||
functionCode : Type.TRANSMIT_MESSAGE,
|
||||
args : [number, jsonData]
|
||||
args : [number, jsonData, timestamp]
|
||||
});
|
||||
this.name = 'SendMessageNetworkError';
|
||||
this.number = number;
|
||||
|
|
|
@ -91,7 +91,7 @@ OutgoingMessage.prototype = {
|
|||
if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410)) {
|
||||
// 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);
|
||||
throw new textsecure.SendMessageNetworkError(number, jsonData, e, timestamp);
|
||||
}
|
||||
throw e;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue