X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/e04c45766d50d6a4e2d3c084145e2115b38bef5c..ae41d0c5026fe868c6198e1005344fc78b6e0a2c:/src/main/java/org/asamk/signal/JsonDataMessage.java diff --git a/src/main/java/org/asamk/signal/JsonDataMessage.java b/src/main/java/org/asamk/signal/JsonDataMessage.java deleted file mode 100644 index efd8e53e..00000000 --- a/src/main/java/org/asamk/signal/JsonDataMessage.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.asamk.signal; - -import org.whispersystems.signalservice.api.messages.SignalServiceAttachment; -import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage; -import org.whispersystems.signalservice.api.messages.SignalServiceGroup; - -import java.util.ArrayList; -import java.util.List; - -class JsonDataMessage { - - long timestamp; - String message; - int expiresInSeconds; - List attachments; - JsonGroupInfo groupInfo; - - JsonDataMessage(SignalServiceDataMessage dataMessage) { - this.timestamp = dataMessage.getTimestamp(); - if (dataMessage.getGroupContext().isPresent() && dataMessage.getGroupContext().get().getGroupV1().isPresent()) { - SignalServiceGroup groupInfo = dataMessage.getGroupContext().get().getGroupV1().get(); - this.groupInfo = new JsonGroupInfo(groupInfo); - } - if (dataMessage.getBody().isPresent()) { - this.message = dataMessage.getBody().get(); - } - this.expiresInSeconds = dataMessage.getExpiresInSeconds(); - if (dataMessage.getAttachments().isPresent()) { - this.attachments = new ArrayList<>(dataMessage.getAttachments().get().size()); - for (SignalServiceAttachment attachment : dataMessage.getAttachments().get()) { - this.attachments.add(new JsonAttachment(attachment)); - } - } else { - this.attachments = new ArrayList<>(); - } - } -}