mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-24 09:34:20 +01:00
Download quote attachment thumbnails and slightly improve the quote output
This commit is contained in:
@@ -452,7 +452,7 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
||||
if (quote.getAttachments().size() > 0) {
|
||||
System.out.println(" Attachments: ");
|
||||
for (SignalServiceDataMessage.Quote.QuotedAttachment attachment : quote.getAttachments()) {
|
||||
System.out.println(" Filename: " + attachment.getFileName());
|
||||
System.out.println(" - Filename: " + attachment.getFileName());
|
||||
System.out.println(" Type: " + attachment.getContentType());
|
||||
System.out.println(" Thumbnail:");
|
||||
if (attachment.getThumbnail() != null) {
|
||||
|
||||
@@ -1690,6 +1690,23 @@ public class Manager implements Closeable {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (message.getQuote().isPresent()) {
|
||||
final SignalServiceDataMessage.Quote quote = message.getQuote().get();
|
||||
|
||||
for (SignalServiceDataMessage.Quote.QuotedAttachment quotedAttachment : quote.getAttachments()) {
|
||||
final SignalServiceAttachment attachment = quotedAttachment.getThumbnail();
|
||||
if (attachment != null && attachment.isPointer()) {
|
||||
try {
|
||||
retrieveAttachment(attachment.asPointer());
|
||||
} catch (IOException | InvalidMessageException | MissingConfigurationException e) {
|
||||
System.err.println("Failed to retrieve attachment ("
|
||||
+ attachment.asPointer().getRemoteId()
|
||||
+ "): "
|
||||
+ e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (message.getSticker().isPresent()) {
|
||||
final SignalServiceDataMessage.Sticker messageSticker = message.getSticker().get();
|
||||
Sticker sticker = account.getStickerStore().getSticker(messageSticker.getPackId());
|
||||
|
||||
Reference in New Issue
Block a user