mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Download quote attachment thumbnails and slightly improve the quote output
This commit is contained in:
parent
83d5d53d8a
commit
548c313b4c
2 changed files with 20 additions and 3 deletions
|
@ -452,9 +452,9 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
||||||
if (quote.getAttachments().size() > 0) {
|
if (quote.getAttachments().size() > 0) {
|
||||||
System.out.println(" Attachments: ");
|
System.out.println(" Attachments: ");
|
||||||
for (SignalServiceDataMessage.Quote.QuotedAttachment attachment : quote.getAttachments()) {
|
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(" Type: " + attachment.getContentType());
|
||||||
System.out.println(" Thumbnail:");
|
System.out.println(" Thumbnail:");
|
||||||
if (attachment.getThumbnail() != null) {
|
if (attachment.getThumbnail() != null) {
|
||||||
printAttachment(attachment.getThumbnail());
|
printAttachment(attachment.getThumbnail());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()) {
|
if (message.getSticker().isPresent()) {
|
||||||
final SignalServiceDataMessage.Sticker messageSticker = message.getSticker().get();
|
final SignalServiceDataMessage.Sticker messageSticker = message.getSticker().get();
|
||||||
Sticker sticker = account.getStickerStore().getSticker(messageSticker.getPackId());
|
Sticker sticker = account.getStickerStore().getSticker(messageSticker.getPackId());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue