Stop preemptively generating screenshots for video stories

This commit is contained in:
trevor-signal 2023-07-17 21:00:02 -04:00 committed by Fedor Indutnyy
parent f798bc999c
commit 54d4734f05
6 changed files with 57 additions and 19 deletions

View file

@ -191,6 +191,30 @@ export function _cleanMessageData(data: MessageType): MessageType {
return omit(attachment, ['data']);
}
if (attachment.screenshotData) {
assertDev(
false,
`_cleanMessageData/${logId}: Attachment ${index} had screenshotData field; deleting`
);
return omit(attachment, ['screenshotData']);
}
if (attachment.screenshot?.data) {
assertDev(
false,
`_cleanMessageData/${logId}: Attachment ${index} had screenshot.data field; deleting`
);
return omit(attachment, ['screenshot.data']);
}
if (attachment.thumbnail?.data) {
assertDev(
false,
`_cleanMessageData/${logId}: Attachment ${index} had thumbnail.data field; deleting`
);
return omit(attachment, ['thumbnail.data']);
}
return attachment;
});
}

View file

@ -1918,8 +1918,14 @@ function saveMessageSync(
if (attachments) {
strictAssert(
attachments.every(attachment => !attachment.data),
'Attempting to save a hydrated message'
attachments.every(
attachment =>
!attachment.data &&
!attachment.screenshotData &&
!attachment.screenshot?.data &&
!attachment.thumbnail?.data
),
'Attempting to save a message with binary attachment data'
);
}