mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 23:23:39 +00:00
Fix videos losing their extension after forwarding.
Special thanks to @signalien Fixes #7783
This commit is contained in:
parent
2882ef6d9f
commit
2acbea014b
@ -69,8 +69,8 @@ public class MediaUtil {
|
|||||||
public static @Nullable String getMimeType(Context context, Uri uri) {
|
public static @Nullable String getMimeType(Context context, Uri uri) {
|
||||||
if (uri == null) return null;
|
if (uri == null) return null;
|
||||||
|
|
||||||
if (PersistentBlobProvider.isAuthority(context, uri)) {
|
if (PartAuthority.isLocalUri(uri)) {
|
||||||
return PersistentBlobProvider.getMimeType(context, uri);
|
return PartAuthority.getAttachmentContentType(context, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
String type = context.getContentResolver().getType(uri);
|
String type = context.getContentResolver().getType(uri);
|
||||||
@ -78,6 +78,7 @@ public class MediaUtil {
|
|||||||
final String extension = MimeTypeMap.getFileExtensionFromUrl(uri.toString());
|
final String extension = MimeTypeMap.getFileExtensionFromUrl(uri.toString());
|
||||||
type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
return getCorrectedMimeType(type);
|
return getCorrectedMimeType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user