Update libsignal-service-java

This commit is contained in:
AsamK 2024-01-14 11:42:48 +01:00
parent 30e8e36635
commit be9efb9a25
5 changed files with 37 additions and 36 deletions

View file

@ -273,7 +273,7 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
}
if (callMessage.answer().isPresent()) {
var answerMessage = callMessage.answer().get();
writer.println("Answer message: {}, sdp: {})", answerMessage.id(), answerMessage.sdp());
writer.println("Answer message: {}, opaque length: {})", answerMessage.id(), answerMessage.opaque().length);
}
if (callMessage.busy().isPresent()) {
var busyMessage = callMessage.busy().get();
@ -287,12 +287,12 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
writer.println("Ice update messages:");
var iceUpdateMessages = callMessage.iceUpdate();
for (var iceUpdateMessage : iceUpdateMessages) {
writer.println("- {}, sdp: {}", iceUpdateMessage.id(), iceUpdateMessage.sdp());
writer.println("- {}, opaque length: {}", iceUpdateMessage.id(), iceUpdateMessage.opaque().length);
}
}
if (callMessage.offer().isPresent()) {
var offerMessage = callMessage.offer().get();
writer.println("Offer message: {}, sdp: {}", offerMessage.id(), offerMessage.sdp());
writer.println("Offer message: {}, opaque length: {}", offerMessage.id(), offerMessage.opaque().length);
}
if (callMessage.opaque().isPresent()) {
final var opaqueMessage = callMessage.opaque().get();

View file

@ -23,20 +23,17 @@ record JsonCallMessage(
callMessage.iceUpdate().stream().map(IceUpdate::from).toList());
}
record Offer(long id, String sdp, String type, String opaque) {
record Offer(long id, String type, String opaque) {
public static Offer from(final MessageEnvelope.Call.Offer offer) {
return new Offer(offer.id(),
offer.sdp(),
offer.type().name(),
Base64.getEncoder().encodeToString(offer.opaque()));
return new Offer(offer.id(), offer.type().name(), Base64.getEncoder().encodeToString(offer.opaque()));
}
}
public record Answer(long id, String sdp, String opaque) {
public record Answer(long id, String opaque) {
public static Answer from(final MessageEnvelope.Call.Answer answer) {
return new Answer(answer.id(), answer.sdp(), Base64.getEncoder().encodeToString(answer.opaque()));
return new Answer(answer.id(), Base64.getEncoder().encodeToString(answer.opaque()));
}
}
@ -54,12 +51,10 @@ record JsonCallMessage(
}
}
public record IceUpdate(long id, String sdp, String opaque) {
public record IceUpdate(long id, String opaque) {
public static IceUpdate from(final MessageEnvelope.Call.IceUpdate iceUpdate) {
return new IceUpdate(iceUpdate.id(),
iceUpdate.sdp(),
Base64.getEncoder().encodeToString(iceUpdate.opaque()));
return new IceUpdate(iceUpdate.id(), Base64.getEncoder().encodeToString(iceUpdate.opaque()));
}
}
}