- final List<VerifiedMessage> verifiedList = syncMessage.getVerified().get();
- for (VerifiedMessage v : verifiedList) {
- System.out.println(" - " + v.getDestination() + ": " + v.getVerified());
- String safetyNumber = formatSafetyNumber(m.computeSafetyNumber(v.getDestination(), v.getIdentityKey()));
- System.out.println(" " + safetyNumber);
+ final VerifiedMessage verifiedMessage = syncMessage.getVerified().get();
+ System.out.println(" - " + verifiedMessage.getDestination() + ": " + verifiedMessage.getVerified());
+ String safetyNumber = formatSafetyNumber(m.computeSafetyNumber(verifiedMessage.getDestination(), verifiedMessage.getIdentityKey()));
+ System.out.println(" " + safetyNumber);
+ }
+ if (syncMessage.getConfiguration().isPresent()) {
+ System.out.println("Received sync message with configuration:");
+ final ConfigurationMessage configurationMessage = syncMessage.getConfiguration().get();
+ if (configurationMessage.getReadReceipts().isPresent()) {
+ System.out.println(" - Read receipts: " + (configurationMessage.getReadReceipts().get() ? "enabled" : "disabled"));
+ }
+ }
+ }
+ if (content.getCallMessage().isPresent()) {
+ System.out.println("Received a call message");
+ SignalServiceCallMessage callMessage = content.getCallMessage().get();
+ if (callMessage.getAnswerMessage().isPresent()) {
+ AnswerMessage answerMessage = callMessage.getAnswerMessage().get();
+ System.out.println("Answer message: " + answerMessage.getId() + ": " + answerMessage.getDescription());
+ }
+ if (callMessage.getBusyMessage().isPresent()) {
+ BusyMessage busyMessage = callMessage.getBusyMessage().get();
+ System.out.println("Busy message: " + busyMessage.getId());
+ }
+ if (callMessage.getHangupMessage().isPresent()) {
+ HangupMessage hangupMessage = callMessage.getHangupMessage().get();
+ System.out.println("Hangup message: " + hangupMessage.getId());
+ }
+ if (callMessage.getIceUpdateMessages().isPresent()) {
+ List<IceUpdateMessage> iceUpdateMessages = callMessage.getIceUpdateMessages().get();
+ for (IceUpdateMessage iceUpdateMessage : iceUpdateMessages) {
+ System.out.println("Ice update message: " + iceUpdateMessage.getId() + ", sdp: " + iceUpdateMessage.getSdp());