mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
Guard against long message attachments rendering
This commit is contained in:
@@ -138,6 +138,7 @@ import type { CallHistorySelectorType } from './callHistory';
|
||||
import { CallMode } from '../../types/Calling';
|
||||
import { CallDirection } from '../../types/CallDisposition';
|
||||
import { getCallIdFromEra } from '../../util/callDisposition';
|
||||
import { LONG_MESSAGE } from '../../types/MIME';
|
||||
|
||||
export { isIncoming, isOutgoing, isStory };
|
||||
|
||||
@@ -313,11 +314,15 @@ export const getAttachmentsForMessage = ({
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
return attachments
|
||||
.filter(attachment => !attachment.error || canBeDownloaded(attachment))
|
||||
.map(attachment => getPropsForAttachment(attachment))
|
||||
.filter(isNotNil);
|
||||
return (
|
||||
attachments
|
||||
.filter(attachment => !attachment.error || canBeDownloaded(attachment))
|
||||
// Long message attachments are removed from message.attachments quickly,
|
||||
// but in case they are still around, let's make sure not to show them
|
||||
.filter(attachment => attachment.contentType !== LONG_MESSAGE)
|
||||
.map(attachment => getPropsForAttachment(attachment))
|
||||
.filter(isNotNil)
|
||||
);
|
||||
};
|
||||
|
||||
export const processBodyRanges = (
|
||||
|
||||
Reference in New Issue
Block a user