Classify all images and videos as visual media

Even if we can’t play it back. Handle that in the lightbox.

Also: Exclude voice messages.
This commit is contained in:
Daniel Gasienica 2018-05-07 14:43:34 -04:00
parent 787d023557
commit 20246c4d07

View file

@ -1,7 +1,6 @@
import is from '@sindresorhus/is';
import moment from 'moment';
import * as GoogleChrome from '../util/GoogleChrome';
import * as MIME from './MIME';
import { arrayBufferToObjectURL } from '../util/arrayBufferToObjectURL';
import { saveURLAsFile } from '../util/saveURLAsFile';
@ -35,9 +34,11 @@ export const isVisualMedia = (attachment: Attachment): boolean => {
return false;
}
const isSupportedImageType = GoogleChrome.isImageTypeSupported(contentType);
const isSupportedVideoType = GoogleChrome.isVideoTypeSupported(contentType);
return isSupportedImageType || isSupportedVideoType;
if (isVoiceMessage(attachment)) {
return false;
}
return MIME.isImage(contentType) || MIME.isVideo(contentType);
};
export const isVoiceMessage = (attachment: Attachment): boolean => {