mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-09-20 06:09:21 +00:00
Pass sender device id to ice handler
This commit is contained in:
parent
7919a0f4aa
commit
d1106299fe
@ -286,7 +286,7 @@ public class CallManager implements AutoCloseable {
|
|||||||
logger.debug("Received answer for call {}", callIdUnsigned(callId));
|
logger.debug("Received answer for call {}", callIdUnsigned(callId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleIncomingIceCandidate(final long callId, final byte[] opaque) {
|
public void handleIncomingIceCandidate(final long callId, final byte[] opaque, final int deviceId) {
|
||||||
var state = activeCalls.get(callId);
|
var state = activeCalls.get(callId);
|
||||||
if (state == null) {
|
if (state == null) {
|
||||||
logger.debug("Received ICE candidate for unknown call {}", callIdUnsigned(callId));
|
logger.debug("Received ICE candidate for unknown call {}", callIdUnsigned(callId));
|
||||||
@ -296,6 +296,7 @@ public class CallManager implements AutoCloseable {
|
|||||||
// Forward to subprocess as receivedIce
|
// Forward to subprocess as receivedIce
|
||||||
var iceMsg = mapper.createObjectNode();
|
var iceMsg = mapper.createObjectNode();
|
||||||
iceMsg.put("type", "receivedIce");
|
iceMsg.put("type", "receivedIce");
|
||||||
|
iceMsg.put("senderDeviceId", deviceId);
|
||||||
var candidates = iceMsg.putArray("candidates");
|
var candidates = iceMsg.putArray("candidates");
|
||||||
candidates.add(java.util.Base64.getEncoder().encodeToString(opaque));
|
candidates.add(java.util.Base64.getEncoder().encodeToString(opaque));
|
||||||
sendControlMessage(state, writeJson(iceMsg));
|
sendControlMessage(state, writeJson(iceMsg));
|
||||||
|
|||||||
@ -433,7 +433,7 @@ public final class IncomingMessageHandler {
|
|||||||
|
|
||||||
callMessage.getIceUpdateMessages().ifPresent(iceUpdates -> {
|
callMessage.getIceUpdateMessages().ifPresent(iceUpdates -> {
|
||||||
for (var ice : iceUpdates) {
|
for (var ice : iceUpdates) {
|
||||||
callManager.handleIncomingIceCandidate(ice.getId(), ice.getOpaque());
|
callManager.handleIncomingIceCandidate(ice.getId(), ice.getOpaque(), deviceId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user