From 8f1650443f3d5826be18c335ba0203cf3191e697 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Mon, 14 Jan 2019 09:56:16 +1100 Subject: [PATCH] Set custom TTL in outgoing message. --- libtextsecure/outgoing_message.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index 9ab24570c..79426037a 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -345,11 +345,11 @@ OutgoingMessage.prototype = { const outgoingObject = outgoingObjects[0]; const socketMessage = await this.wrapInWebsocketMessage(outgoingObject); let ttl; - // TODO: Allow user to set ttl manually if (outgoingObject.type === textsecure.protobuf.Envelope.Type.FRIEND_REQUEST) { ttl = 4 * 24 * 60 * 60; // 4 days for friend request message } else { - ttl = 24 * 60 * 60; // 1 day default for any other message + const hours = window.getMessageTTL() || 24; // 1 day default for any other message + ttl = hours * 60 * 60; } await this.transmitMessage(number, socketMessage, this.timestamp, ttl); this.successfulNumbers[this.successfulNumbers.length] = number;