Keep the original filename while sending attachment as file
This commit is contained in:
parent
f11fb2f8ce
commit
102018bbb1
1 changed files with 7 additions and 11 deletions
|
@ -773,17 +773,13 @@ public class FileBackend {
|
|||
if ("ogg".equals(extension) && type != null && type.startsWith("audio/")) {
|
||||
extension = "oga";
|
||||
}
|
||||
String filename = "Sent" + File.separator + fileDateFormat.format(new Date(message.getTimeSent())) + "_" + message.getUuid().substring(0, 4);
|
||||
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);
|
||||
|
||||
String filename = String.format("%s.%s", mXmppConnectionService.getFileBackend().getFile(message).getName(), extension);
|
||||
setupRelativeFilePath(message, filename, mime);
|
||||
copyFileToPrivateStorage(mXmppConnectionService.getFileBackend().getFile(message), uri);
|
||||
final String name = getDisplayNameFromUri(uri);
|
||||
if (name != null) {
|
||||
message.getFileParams().setName(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue