mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Output json when receiving messages from dbus and --json parameter is given
Fixes #138
This commit is contained in:
parent
e04c45766d
commit
ae41d0c502
15 changed files with 176 additions and 50 deletions
21
src/main/java/org/asamk/signal/json/JsonSyncDataMessage.java
Normal file
21
src/main/java/org/asamk/signal/json/JsonSyncDataMessage.java
Normal file
|
@ -0,0 +1,21 @@
|
|||
package org.asamk.signal.json;
|
||||
|
||||
import org.asamk.Signal;
|
||||
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
|
||||
|
||||
class JsonSyncDataMessage extends JsonDataMessage {
|
||||
|
||||
String destination;
|
||||
|
||||
JsonSyncDataMessage(SentTranscriptMessage transcriptMessage) {
|
||||
super(transcriptMessage.getMessage());
|
||||
if (transcriptMessage.getDestination().isPresent()) {
|
||||
this.destination = transcriptMessage.getDestination().get().getNumber().get();
|
||||
}
|
||||
}
|
||||
|
||||
JsonSyncDataMessage(Signal.SyncMessageReceived messageReceived) {
|
||||
super(messageReceived);
|
||||
destination = messageReceived.getDestination();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue