aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/persistance
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-16 02:39:02 +0200
committeriNPUTmice <daniel@gultsch.de>2014-10-16 02:39:02 +0200
commit88d88ffb7b704e2ae5a2eaf1af6e8a21fb0fb574 (patch)
tree0434c3b0eb6ba27ba7f9ff5d3fa27dc025f5b676 /src/eu/siacs/conversations/persistance
parentf5019ba96647bd1c33153e6e9099d21dcf47bfa7 (diff)
added file observer to get notified when files are deleted: fixes #396
Diffstat (limited to 'src/eu/siacs/conversations/persistance')
-rw-r--r--src/eu/siacs/conversations/persistance/FileBackend.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java
index 72c620a7..74918670 100644
--- a/src/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/eu/siacs/conversations/persistance/FileBackend.java
@@ -72,9 +72,7 @@ public class FileBackend {
public DownloadableFile getFile(Message message,
boolean decrypted) {
StringBuilder filename = new StringBuilder();
- filename.append(Environment.getExternalStoragePublicDirectory(
- Environment.DIRECTORY_PICTURES).getAbsolutePath());
- filename.append("/Conversations/");
+ filename.append(getConversationsDirectory());
filename.append(message.getUuid());
if ((decrypted) || (message.getEncryption() == Message.ENCRYPTION_NONE)) {
filename.append(".webp");
@@ -87,6 +85,11 @@ public class FileBackend {
}
return new DownloadableFile(filename.toString());
}
+
+ public static String getConversationsDirectory() {
+ return Environment.getExternalStoragePublicDirectory(
+ Environment.DIRECTORY_PICTURES).getAbsolutePath()+"/Conversations/";
+ }
public Bitmap resize(Bitmap originalBitmap, int size) {
int w = originalBitmap.getWidth();