aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-03-06 21:47:58 +0100
committerChristian Schneppe <christian@pix-art.de>2019-03-06 21:47:58 +0100
commit92cb4deda27fc4aff1a2ded9419d2bcf91eee353 (patch)
treed09902bda87bef38a19ce95d6d6ab2ac7e33f925 /src/main/java
parentd393a18232f514aead394f404f61ad52bfb9d5f8 (diff)
only show images and videos in media browser
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index e85eab5c9..0aac6520a 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -264,7 +264,9 @@ public class FileBackend {
for (DatabaseBackend.FilePath relativeFilePath : relativeFilePaths) {
final String mime = MimeUtils.guessMimeTypeFromExtension(MimeUtils.extractRelevantExtension(relativeFilePath.path));
final File file = getFileForPath(relativeFilePath.path, mime);
- attachments.add(Attachment.of(relativeFilePath.uuid, file, mime));
+ if (mime != null && (mime.startsWith("image/") || mime.startsWith("video/"))) {
+ attachments.add(Attachment.of(relativeFilePath.uuid, file, mime));
+ }
}
return attachments;
}