From 97a6c82ff90650816b103616f3cbe1e585eb1721 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 25 Nov 2017 22:37:58 +0100 Subject: don't return null for opus file extensions --- src/main/java/de/pixart/messenger/persistance/FileBackend.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/de/pixart/messenger/persistance') diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java index ce8219f6e..3a53d31b9 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -341,6 +341,9 @@ public class FileBackend { if (extension == null) { extension = getExtensionFromUri(uri); } + if (extension == null) { + extension = MimeUtils.guessExtensionFromMimeType(mime); + } String filename = fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4); message.setRelativeFilePath(filename + "." + extension); copyFileToPrivateStorage(mXmppConnectionService.getFileBackend().getFile(message), uri); -- cgit v1.2.3