diff --git a/src/main/java/org/asamk/signal/JsonAttachment.java b/src/main/java/org/asamk/signal/JsonAttachment.java index 29e8592e..785fa9e2 100644 --- a/src/main/java/org/asamk/signal/JsonAttachment.java +++ b/src/main/java/org/asamk/signal/JsonAttachment.java @@ -6,14 +6,19 @@ import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPoin class JsonAttachment { String contentType; + String filename; long id; int size; JsonAttachment(SignalServiceAttachment attachment) { this.contentType = attachment.getContentType(); + final SignalServiceAttachmentPointer pointer = attachment.asPointer(); if (attachment.isPointer()) { this.id = pointer.getId(); + if (pointer.getFileName().isPresent()) { + this.filename = pointer.getFileName().get(); + } if (pointer.getSize().isPresent()) { this.size = pointer.getSize().get(); }