mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Use var instead of explicit types
This commit is contained in:
parent
03c30519b1
commit
de273586b4
77 changed files with 850 additions and 1017 deletions
|
@ -3,8 +3,6 @@ package org.asamk.signal.json;
|
|||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer;
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream;
|
||||
|
||||
class JsonAttachment {
|
||||
|
||||
|
@ -24,12 +22,12 @@ class JsonAttachment {
|
|||
this.contentType = attachment.getContentType();
|
||||
|
||||
if (attachment.isPointer()) {
|
||||
final SignalServiceAttachmentPointer pointer = attachment.asPointer();
|
||||
final var pointer = attachment.asPointer();
|
||||
this.id = pointer.getRemoteId().toString();
|
||||
this.filename = pointer.getFileName().orNull();
|
||||
this.size = pointer.getSize().transform(Integer::longValue).orNull();
|
||||
} else {
|
||||
final SignalServiceAttachmentStream stream = attachment.asStream();
|
||||
final var stream = attachment.asStream();
|
||||
this.id = null;
|
||||
this.filename = stream.getFileName().orNull();
|
||||
this.size = stream.getLength();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue