mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Expose filename of attachments to json message handler (#185)
This commit is contained in:
parent
a055f282c6
commit
58895aaf03
1 changed files with 5 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue