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/JsonSyncMessage.java
Normal file
24
src/main/java/org/asamk/signal/JsonSyncMessage.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package org.asamk.signal;
|
||||
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.ReadMessage;
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class JsonSyncMessage {
|
||||
JsonDataMessage sentMessage;
|
||||
List<String> blockedNumbers;
|
||||
List<ReadMessage> readMessages;
|
||||
|
||||
JsonSyncMessage(SignalServiceSyncMessage syncMessage) {
|
||||
if (syncMessage.getSent().isPresent()) {
|
||||
this.sentMessage = new JsonDataMessage(syncMessage.getSent().get().getMessage());
|
||||
}
|
||||
if (syncMessage.getBlockedList().isPresent()) {
|
||||
this.blockedNumbers = syncMessage.getBlockedList().get().getNumbers();
|
||||
}
|
||||
if (syncMessage.getRead().isPresent()) {
|
||||
this.readMessages = syncMessage.getRead().get();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue