mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-23 07:58:30 +00:00
parent
edb04138c2
commit
d3da409774
@ -486,12 +486,18 @@ public class ConversationFragment extends SherlockListFragment
|
|||||||
|
|
||||||
MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
|
MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
|
||||||
String extension = mimeTypeMap.getExtensionFromMimeType(slide.getContentType());
|
String extension = mimeTypeMap.getExtensionFromMimeType(slide.getContentType());
|
||||||
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd-HHmmss");
|
||||||
|
String base = "textsecure-" + dateFormatter.format(timestamp);
|
||||||
|
|
||||||
if (extension == null)
|
if (extension == null)
|
||||||
extension = "attach";
|
extension = "attach";
|
||||||
|
|
||||||
return File.createTempFile("textsecure-" + dateFormatter.format(timestamp), "." + extension, outputDirectory);
|
int i = 0;
|
||||||
|
File file = new File(outputDirectory, base+"."+extension);
|
||||||
|
while (file.exists())
|
||||||
|
file = new File(outputDirectory, base+"-"+(++i)+"."+extension);
|
||||||
|
|
||||||
|
return file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user