diff options
Diffstat (limited to 'src')
3 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java index 4ec31c915..a3bcbb386 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java @@ -93,7 +93,7 @@ public class HttpDownloadConnection implements Transferable { } else { extension = lastPart; } - String filename = fileDateFormat.format(new Date(message.getTimeSent())); + String filename = fileDateFormat.format(new Date(message.getTimeSent()))+"_"+message.getUuid().substring(0,4); message.setRelativeFilePath(filename + "." + extension); this.file = mXmppConnectionService.getFileBackend().getFile(message, false); String reference = mUrl.getRef(); diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 8d3a8f608..0d8840cc2 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -105,7 +105,7 @@ public class FileBackend { final DownloadableFile file; String path = message.getRelativeFilePath(); if (path == null) { - String filename = fileDateFormat.format(new Date(message.getTimeSent())); + String filename = fileDateFormat.format(new Date(message.getTimeSent()))+"_"+message.getUuid().substring(0,4); path = filename; } if (path.startsWith("/")) { @@ -267,7 +267,7 @@ public class FileBackend { Log.d(Config.LOGTAG, "copy " + uri.toString() + " to private storage"); String mime = mXmppConnectionService.getContentResolver().getType(uri); String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mime); - String filename = fileDateFormat.format(new Date(message.getTimeSent())); + String filename = fileDateFormat.format(new Date(message.getTimeSent()))+"_"+message.getUuid().substring(0,4); message.setRelativeFilePath(filename + "." + extension); copyFileToPrivateStorage(mXmppConnectionService.getFileBackend().getFile(message), uri); } diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java index 11b07e86f..b3fa7a762 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java @@ -319,7 +319,7 @@ public class JingleConnection implements Transferable { if (fileNameElement != null) { String[] filename = fileNameElement.getContent() .toLowerCase(Locale.US).toLowerCase().split("\\."); - String filename_new = fileDateFormat.format(new Date(message.getTimeSent())); + String filename_new = fileDateFormat.format(new Date(message.getTimeSent()))+"_"+message.getUuid().substring(0,4); String extension = filename[filename.length - 1]; if (VALID_IMAGE_EXTENSIONS.contains(extension)) { message.setType(Message.TYPE_IMAGE); |