Use timestamp instead of full model for tap-to-view age outs

This commit is contained in:
Evan Hahn 2021-05-19 11:17:51 -05:00 committed by Scott Nonnenberg
parent 80da8bb47b
commit f3e207d0b0
4 changed files with 15 additions and 30 deletions

View file

@ -50,16 +50,11 @@
const HOUR = 60 * MINUTE;
const THIRTY_DAYS = 30 * 24 * HOUR;
const toAgeOut = await window.Signal.Data.getNextTapToViewMessageToAgeOut({
Message: Whisper.Message,
});
if (!toAgeOut) {
const receivedAt = await window.Signal.Data.getNextTapToViewMessageTimestampToAgeOut();
if (!receivedAt) {
return;
}
const receivedAt =
toAgeOut.get('received_at_ms') || toAgeOut.get('received_at');
const nextCheck = receivedAt + THIRTY_DAYS;
Whisper.TapToViewMessagesListener.nextCheck = nextCheck;