mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Implement json output for receive
This commit is contained in:
parent
a1f0d74a99
commit
8717665d1d
9 changed files with 225 additions and 2 deletions
24
src/main/java/org/asamk/signal/JsonGroupInfo.java
Normal file
24
src/main/java/org/asamk/signal/JsonGroupInfo.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package org.asamk.signal;
|
||||
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceGroup;
|
||||
import org.whispersystems.signalservice.internal.util.Base64;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class JsonGroupInfo {
|
||||
String groupId;
|
||||
List<String> members;
|
||||
String name;
|
||||
String type;
|
||||
|
||||
JsonGroupInfo(SignalServiceGroup groupInfo) {
|
||||
this.groupId = Base64.encodeBytes(groupInfo.getGroupId());
|
||||
if (groupInfo.getMembers().isPresent()) {
|
||||
this.members = groupInfo.getMembers().get();
|
||||
}
|
||||
if (groupInfo.getName().isPresent()) {
|
||||
this.name = groupInfo.getName().get();
|
||||
}
|
||||
this.type = groupInfo.getType().toString();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue