diff --git a/src/main/java/de/monocles/chat/DownloadDefaultStickers.java b/src/main/java/de/monocles/chat/DownloadDefaultStickers.java index e55bf6d880..e580997094 100644 --- a/src/main/java/de/monocles/chat/DownloadDefaultStickers.java +++ b/src/main/java/de/monocles/chat/DownloadDefaultStickers.java @@ -103,7 +103,7 @@ public class DownloadDefaultStickers extends Service { Response r = http.newCall(new Request.Builder().url(sticker.getString("url")).build()).execute(); File file = null; try { - file = new File(mStickerDir.getAbsolutePath() + "/" + sticker.getString("pack") + "/" + sticker.getString("name") + "." + MimeUtils.guessExtensionFromMimeType(r.headers().get("content-type"))); + file = new File(mStickerDir.getAbsolutePath() + "/" + sticker.getString("name") + "." + MimeUtils.guessExtensionFromMimeType(r.headers().get("content-type"))); file.getParentFile().mkdirs(); OutputStream os = new FileOutputStream(file); if (r.body() != null) { diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 9bbd19a789..87ca59d4b8 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -3746,14 +3746,14 @@ public class ConversationFragment extends XmppFragment InputStream in; OutputStream out; try { - File stickerfolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + "User"); + File stickerfolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers"); //create output directory if it doesn't exist if (!stickerfolder.exists()) { stickerfolder.mkdirs(); } String filename = "user_" + getConversation().getName() + "_" + System.currentTimeMillis(); - File newSticker = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + "User" + File.separator + filename + ".jpg"); + File newSticker = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + filename + ".jpg"); in = activity.getContentResolver().openInputStream(imageUri); out = new FileOutputStream(newSticker); diff --git a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java index 9c24dc03d3..c8c7db01cb 100644 --- a/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/SettingsActivity.java @@ -190,13 +190,13 @@ public class SettingsActivity extends XmppActivity implements OnSharedPreference InputStream in; OutputStream out; try { - File stickerfolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + "Custom"); + File stickerfolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers"); //create output directory if it doesn't exist if (!stickerfolder.exists()) { stickerfolder.mkdirs(); } String filename = getFileName(imageUri); - File newSticker = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + "Custom" + File.separator + filename); + File newSticker = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + filename); in = getContentResolver().openInputStream(imageUri); out = new FileOutputStream(newSticker); @@ -229,13 +229,13 @@ public class SettingsActivity extends XmppActivity implements OnSharedPreference InputStream in; OutputStream out; try { - File stickerfolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + "Custom"); + File stickerfolder = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers"); //create output directory if it doesn't exist if (!stickerfolder.exists()) { stickerfolder.mkdirs(); } String filename = getFileName(imageUri); - File newSticker = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + "Custom" + File.separator + filename); + File newSticker = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Stickers" + File.separator + filename); in = getContentResolver().openInputStream(imageUri); out = new FileOutputStream(newSticker);