Download quote attachment thumbnails and slightly improve the quote output

This commit is contained in:
AsamK 2020-12-23 00:18:21 +01:00
parent 83d5d53d8a
commit 548c313b4c
2 changed files with 20 additions and 3 deletions

View file

@ -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());