forked from mirror/monocles_chat_clean
Revert "Code clean up + possible fix sent images in main image folder"
This reverts commit fe675aa5
This commit is contained in:
parent
01fe240395
commit
45cd31cd7b
1 changed files with 23 additions and 5 deletions
|
@ -228,6 +228,19 @@ public class FileBackend {
|
|||
message.setFileParams(fileParams);
|
||||
}
|
||||
|
||||
private void createNoMedia(File diretory) {
|
||||
final File noMedia = new File(diretory, ".nomedia");
|
||||
if (!noMedia.exists()) {
|
||||
try {
|
||||
if (!noMedia.createNewFile()) {
|
||||
Log.d(Config.LOGTAG, "created nomedia file " + noMedia.getAbsolutePath());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d(Config.LOGTAG, "could not create nomedia file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateMediaScanner(XmppConnectionService mXmppConnectionService, File file) {
|
||||
updateMediaScanner(mXmppConnectionService, file, null);
|
||||
}
|
||||
|
@ -796,11 +809,16 @@ public class FileBackend {
|
|||
extension = "oga";
|
||||
}
|
||||
String filename = "Sent" + File.separator + fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4);
|
||||
setupRelativeFilePath(message, String.format("%s.%s", filename, extension));
|
||||
copyFileToPrivateStorage(mXmppConnectionService.getFileBackend().getFile(message), uri);
|
||||
final String name = getDisplayNameFromUri(uri);
|
||||
if (name != null) {
|
||||
message.getFileParams().setName(name);
|
||||
try {
|
||||
setupRelativeFilePath(message, uri, extension);
|
||||
copyFileToPrivateStorage(mXmppConnectionService.getFileBackend().getFile(message), uri);
|
||||
final String name = getDisplayNameFromUri(uri);
|
||||
if (name != null) {
|
||||
message.getFileParams().setName(name);
|
||||
}
|
||||
} catch (final XmppConnectionService.BlockedMediaException e) {
|
||||
message.setRelativeFilePath(null);
|
||||
message.setDeleted(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue