mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Update libsignal-service
This commit is contained in:
parent
4d8b103570
commit
6c4d272309
3 changed files with 13 additions and 10 deletions
|
@ -58,7 +58,7 @@ class Utils {
|
|||
return signalServiceAttachments;
|
||||
}
|
||||
|
||||
private static String getFileMimeType(File file) throws IOException {
|
||||
static String getFileMimeType(File file, String defaultMimeType) throws IOException {
|
||||
String mime = Files.probeContentType(file.toPath());
|
||||
if (mime == null) {
|
||||
try (InputStream bufferedStream = new BufferedInputStream(new FileInputStream(file))) {
|
||||
|
@ -66,7 +66,7 @@ class Utils {
|
|||
}
|
||||
}
|
||||
if (mime == null) {
|
||||
mime = "application/octet-stream";
|
||||
return defaultMimeType;
|
||||
}
|
||||
return mime;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class Utils {
|
|||
static SignalServiceAttachmentStream createAttachment(File attachmentFile) throws IOException {
|
||||
InputStream attachmentStream = new FileInputStream(attachmentFile);
|
||||
final long attachmentSize = attachmentFile.length();
|
||||
final String mime = getFileMimeType(attachmentFile);
|
||||
final String mime = getFileMimeType(attachmentFile, "application/octet-stream");
|
||||
// TODO mabybe add a parameter to set the voiceNote, borderless, preview, width, height and caption option
|
||||
final long uploadTimestamp = System.currentTimeMillis();
|
||||
Optional<byte[]> preview = Optional.absent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue