mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Make use of attachment size and preview
This commit is contained in:
parent
b91abad2b5
commit
cd8de7878c
2 changed files with 20 additions and 2 deletions
|
@ -292,11 +292,27 @@ class Manager {
|
|||
} finally {
|
||||
if (output != null) {
|
||||
output.close();
|
||||
output = null;
|
||||
}
|
||||
if (!tmpFile.delete()) {
|
||||
System.err.println("Failed to delete temp file: " + tmpFile);
|
||||
}
|
||||
}
|
||||
if (pointer.getPreview().isPresent()) {
|
||||
File previewFile = new File(outputFile + ".preview");
|
||||
try {
|
||||
output = new FileOutputStream(previewFile);
|
||||
byte[] preview = pointer.getPreview().get();
|
||||
output.write(preview, 0, preview.length);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} finally {
|
||||
if (output != null) {
|
||||
output.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
return outputFile;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue