1
0
Fork 1

Store voice messages in cache too when store in cache activated

This commit is contained in:
Arne 2024-11-25 17:25:12 +01:00
parent bfbaf3278a
commit dc33e904e5

View file

@ -5469,6 +5469,9 @@ public class ConversationFragment extends XmppFragment
final String filename = final String filename =
String.format("RECORDING_%s.%s", dateFormat.format(new Date()), extension); String.format("RECORDING_%s.%s", dateFormat.format(new Date()), extension);
final File parentDirectory; final File parentDirectory;
if (conversation.storeInCache()) {
parentDirectory = new File(activity.xmppConnectionService.getCacheDir(), "/media");
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
parentDirectory = parentDirectory =
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RECORDINGS); Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RECORDINGS);
@ -5476,6 +5479,7 @@ public class ConversationFragment extends XmppFragment
parentDirectory = parentDirectory =
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
} }
}
final File conversationsDirectory = new File(parentDirectory, getString(R.string.app_name)); final File conversationsDirectory = new File(parentDirectory, getString(R.string.app_name));
return new File(conversationsDirectory, filename); return new File(conversationsDirectory, filename);
} }