Display more information for received messages

This commit is contained in:
AsamK 2019-12-31 13:02:49 +01:00
parent 6cfddc0aff
commit 3b2682a57a
2 changed files with 41 additions and 0 deletions

View file

@ -1049,6 +1049,19 @@ public class Manager implements Signal {
}
contact.profileKey = Base64.encodeBytes(message.getProfileKey().get());
}
if (message.getPreviews().isPresent()) {
final List<SignalServiceDataMessage.Preview> previews = message.getPreviews().get();
for (SignalServiceDataMessage.Preview preview : previews) {
if (preview.getImage().isPresent() && preview.getImage().get().isPointer()) {
SignalServiceAttachmentPointer attachment = preview.getImage().get().asPointer();
try {
retrieveAttachment(attachment);
} catch (IOException | InvalidMessageException e) {
System.err.println("Failed to retrieve attachment (" + attachment.getId() + "): " + e.getMessage());
}
}
}
}
}
private void retryFailedReceivedMessages(ReceiveMessageHandler handler, boolean ignoreAttachments) {