aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-05-19 21:43:46 +0200
committerChristian Schneppe <christian@pix-art.de>2019-05-19 21:43:46 +0200
commit6e040b7ac2a1fb5152df40e0a7ca961e827a32e6 (patch)
tree32f3e7c017a2cc94cc6f3f1f4f7067863ded2381 /src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
parentdfe1a58e0adbf1241650178198b6d263a71e76c0 (diff)
separate received and sent files
fixes #140
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
index c53919784..e5f5d878a 100644
--- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
@@ -95,7 +95,11 @@ public class HttpDownloadConnection implements Transferable {
} else {
extension = lastPart;
}
- message.setRelativeFilePath(fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4) + (extension != null ? ("." + extension) : ""));
+ if (message.getStatus() == Message.STATUS_RECEIVED){
+ message.setRelativeFilePath(fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4) + (extension != null ? ("." + extension) : ""));
+ } else {
+ message.setRelativeFilePath("Sent/" + fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4) + (extension != null ? ("." + extension) : ""));
+ }
this.file = mXmppConnectionService.getFileBackend().getFile(message, false);
final String reference = mUrl.getRef();
if (reference != null && AesGcmURLStreamHandler.IV_KEY.matcher(reference).matches()) {