From af8b48b3400b5eac6ddb22b1efde19b10dac3183 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 30 Jan 2018 20:15:01 +0100 Subject: discover file extension in original filename from pgp --- src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/http') diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java index d8fdfb79e..9985cf929 100644 --- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java @@ -95,7 +95,7 @@ public class HttpDownloadConnection implements Transferable { extension = lastPart; } String filename = fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4); - message.setRelativeFilePath(filename + "." + extension); + message.setRelativeFilePath(filename + (extension != null ? ("." + extension) : "")); this.file = mXmppConnectionService.getFileBackend().getFile(message, false); final String reference = mUrl.getRef(); if (reference != null && AesGcmURLStreamHandler.IV_KEY.matcher(reference).matches()) { -- cgit v1.2.3