Ensure message expire timer start times are never in the future

This commit is contained in:
Scott Nonnenberg 2018-05-30 18:07:25 -07:00
parent f3bd0cf903
commit 71d873ccfe
2 changed files with 7 additions and 3 deletions

View file

@ -720,6 +720,7 @@
function createSentMessage(data) {
const now = Date.now();
return new Whisper.Message({
source: textsecure.storage.user.getNumber(),
sourceDevice: data.device,
@ -728,7 +729,9 @@
conversationId: data.destination,
type: 'outgoing',
sent: true,
expirationStartTimestamp: data.expirationStartTimestamp,
expirationStartTimestamp: data.expirationStartTimestamp
? Math.min(data.expirationStartTimestamp, Date.now())
: null,
});
}