From 2acbea014b09e86585b00e5d29de9c2795e06aa5 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 13 Aug 2018 16:55:58 -0400 Subject: [PATCH] Fix videos losing their extension after forwarding. Special thanks to @signalien Fixes #7783 --- src/org/thoughtcrime/securesms/util/MediaUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/util/MediaUtil.java b/src/org/thoughtcrime/securesms/util/MediaUtil.java index afdb952f01..48cf29cc76 100644 --- a/src/org/thoughtcrime/securesms/util/MediaUtil.java +++ b/src/org/thoughtcrime/securesms/util/MediaUtil.java @@ -69,8 +69,8 @@ public class MediaUtil { public static @Nullable String getMimeType(Context context, Uri uri) { if (uri == null) return null; - if (PersistentBlobProvider.isAuthority(context, uri)) { - return PersistentBlobProvider.getMimeType(context, uri); + if (PartAuthority.isLocalUri(uri)) { + return PartAuthority.getAttachmentContentType(context, uri); } String type = context.getContentResolver().getType(uri); @@ -78,6 +78,7 @@ public class MediaUtil { final String extension = MimeTypeMap.getFileExtensionFromUrl(uri.toString()); type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase()); } + return getCorrectedMimeType(type); }