message.setToExpire: Log start timestamp, log before save

This commit is contained in:
Scott Nonnenberg 2020-11-11 08:21:06 -08:00 committed by GitHub
parent 89d5972522
commit 1d1fccd96f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1814,17 +1814,19 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
const expiresAt = start + delta;
this.set({ expires_at: expiresAt });
window.log.info('Set message expiration', {
start,
expiresAt,
sentAt: this.get('sent_at'),
});
const id = this.get('id');
if (id && !skipSave) {
await window.Signal.Data.saveMessage(this.attributes, {
Message: window.Whisper.Message,
});
}
window.log.info('Set message expiration', {
expiresAt,
sentAt: this.get('sent_at'),
});
}
}