Force set expirationStartTimestamp on story messages

This commit is contained in:
Josh Perez 2022-04-11 17:28:01 -04:00 committed by GitHub
parent 7f89f6162f
commit 9f7ee9ae79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 2 deletions

View file

@ -2790,6 +2790,20 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
}
}
if (
isStory(message.attributes) &&
!message.get('expirationStartTimestamp')
) {
message.set(
'expirationStartTimestamp',
Math.min(
message.get('serverTimestamp') || message.get('timestamp'),
Date.now()
)
);
changed = true;
}
// Does this message have any pending, previously-received associated reactions?
const reactions = Reactions.getSingleton().forMessage(message);
await Promise.all(