mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 19:10:38 +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
31
src/main/java/org/asamk/signal/JsonCallMessage.java
Normal file
31
src/main/java/org/asamk/signal/JsonCallMessage.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
package org.asamk.signal;
|
||||
|
||||
import org.whispersystems.signalservice.api.messages.calls.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class JsonCallMessage {
|
||||
OfferMessage offerMessage;
|
||||
AnswerMessage answerMessage;
|
||||
BusyMessage busyMessage;
|
||||
HangupMessage hangupMessage;
|
||||
List<IceUpdateMessage> iceUpdateMessages;
|
||||
|
||||
JsonCallMessage(SignalServiceCallMessage callMessage) {
|
||||
if (callMessage.getOfferMessage().isPresent()) {
|
||||
this.offerMessage = callMessage.getOfferMessage().get();
|
||||
}
|
||||
if (callMessage.getAnswerMessage().isPresent()) {
|
||||
this.answerMessage = callMessage.getAnswerMessage().get();
|
||||
}
|
||||
if (callMessage.getBusyMessage().isPresent()) {
|
||||
this.busyMessage = callMessage.getBusyMessage().get();
|
||||
}
|
||||
if (callMessage.getHangupMessage().isPresent()) {
|
||||
this.hangupMessage = callMessage.getHangupMessage().get();
|
||||
}
|
||||
if (callMessage.getIceUpdateMessages().isPresent()) {
|
||||
this.iceUpdateMessages = callMessage.getIceUpdateMessages().get();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue