mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40: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 {
|
class JsonAttachment {
|
||||||
|
|
||||||
String contentType;
|
String contentType;
|
||||||
|
String filename;
|
||||||
long id;
|
long id;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
JsonAttachment(SignalServiceAttachment attachment) {
|
JsonAttachment(SignalServiceAttachment attachment) {
|
||||||
this.contentType = attachment.getContentType();
|
this.contentType = attachment.getContentType();
|
||||||
|
|
||||||
final SignalServiceAttachmentPointer pointer = attachment.asPointer();
|
final SignalServiceAttachmentPointer pointer = attachment.asPointer();
|
||||||
if (attachment.isPointer()) {
|
if (attachment.isPointer()) {
|
||||||
this.id = pointer.getId();
|
this.id = pointer.getId();
|
||||||
|
if (pointer.getFileName().isPresent()) {
|
||||||
|
this.filename = pointer.getFileName().get();
|
||||||
|
}
|
||||||
if (pointer.getSize().isPresent()) {
|
if (pointer.getSize().isPresent()) {
|
||||||
this.size = pointer.getSize().get();
|
this.size = pointer.getSize().get();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue