X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/8717665d1d273a32afef136c15c0d5abaaae0f85..e684a902bb40e56286fad3991c8f6cd44534b588:/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 index eda54025..efd8e53e 100644 --- a/src/main/java/org/asamk/signal/JsonDataMessage.java +++ b/src/main/java/org/asamk/signal/JsonDataMessage.java @@ -2,11 +2,13 @@ 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; @@ -15,8 +17,9 @@ class JsonDataMessage { JsonDataMessage(SignalServiceDataMessage dataMessage) { this.timestamp = dataMessage.getTimestamp(); - if (dataMessage.getGroupInfo().isPresent()) { - this.groupInfo = new JsonGroupInfo(dataMessage.getGroupInfo().get()); + 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();