mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add group v2 id to json output
This commit is contained in:
parent
4d17e50323
commit
2617757edb
3 changed files with 18 additions and 3 deletions
|
@ -4,6 +4,7 @@ import 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 org.whispersystems.signalservice.api.messages.SignalServiceGroupV2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -19,9 +20,14 @@ class JsonDataMessage {
|
|||
|
||||
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.getGroupContext().isPresent()) {
|
||||
if (dataMessage.getGroupContext().get().getGroupV1().isPresent()) {
|
||||
SignalServiceGroup groupInfo = dataMessage.getGroupContext().get().getGroupV1().get();
|
||||
this.groupInfo = new JsonGroupInfo(groupInfo);
|
||||
} else if (dataMessage.getGroupContext().get().getGroupV2().isPresent()) {
|
||||
SignalServiceGroupV2 groupInfo = dataMessage.getGroupContext().get().getGroupV2().get();
|
||||
this.groupInfo = new JsonGroupInfo(groupInfo);
|
||||
}
|
||||
}
|
||||
if (dataMessage.getBody().isPresent()) {
|
||||
this.message = dataMessage.getBody().get();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue