aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/persistance
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-05 13:00:06 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-05 13:00:06 +0200
commit08755e56a5bf861c97eefd545f629ac67a804275 (patch)
treec7f5ce044e860d328cd87d30e88d7092a9f581c8 /src/eu/siacs/conversations/persistance
parent9aba9a4059bdc1c2f369585ef6faeada320529d2 (diff)
show own avatar after publication. no persistancy yet
Diffstat (limited to 'src/eu/siacs/conversations/persistance')
-rw-r--r--src/eu/siacs/conversations/persistance/FileBackend.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java
index 9a94329ad..4014cf608 100644
--- a/src/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/eu/siacs/conversations/persistance/FileBackend.java
@@ -249,8 +249,7 @@ public class FileBackend {
}
public void save(Avatar avatar) {
- String path = context.getFilesDir().getAbsolutePath() + "/avatars/";
- File file = new File(path+"/"+avatar.getFilename());
+ File file = new File(getAvatarPath(context, avatar.getFilename()));
file.getParentFile().mkdirs();
Log.d("xmppService",file.getAbsolutePath());
try {
@@ -271,6 +270,10 @@ public class FileBackend {
e.printStackTrace();
}
}
+
+ public static String getAvatarPath(Context context, String avatar) {
+ return context.getFilesDir().getAbsolutePath() + "/avatars/"+avatar;
+ }
public Bitmap cropCenterSquare(Uri image, int size) {
try {