Merge pull request #1114 from nextcloud/fix-own-peer-handling-when-hpb-is-used

Fix own peer handling when HPB is used
This commit is contained in:
Marcel Hibbe 2021-07-02 15:16:03 +02:00 committed by GitHub
commit 23883c582c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1655,8 +1655,16 @@ public class CallController extends BaseController {
List<String> newSessions = new ArrayList<>();
Set<String> oldSesssions = new HashSet<>();
hasMCU = hasExternalSignalingServer && webSocketClient != null && webSocketClient.hasMCU();
// The signaling session is the same as the Nextcloud session only when the MCU is not used.
String currentSessiondId = callSession;
if (hasMCU) {
currentSessiondId = webSocketClient.getSessionId();
}
for (HashMap<String, Object> participant : users) {
if (!participant.get("sessionId").equals(callSession)) {
if (!participant.get("sessionId").equals(currentSessiondId)) {
Object inCallObject = participant.get("inCall");
boolean isNewSession;
if (inCallObject instanceof Boolean) {
@ -1693,10 +1701,13 @@ public class CallController extends BaseController {
getPeersForCall();
}
hasMCU = hasExternalSignalingServer && webSocketClient != null && webSocketClient.hasMCU();
if (hasMCU) {
// Ensure that own publishing peer is set up.
getPeerConnectionWrapperForSessionIdAndType(webSocketClient.getSessionId(), "video", true);
}
for (String sessionId : newSessions) {
getPeerConnectionWrapperForSessionIdAndType(sessionId, "video", hasMCU && sessionId.equals(webSocketClient.getSessionId()));
getPeerConnectionWrapperForSessionIdAndType(sessionId, "video", false);
}
if (newSessions.size() > 0 && !currentCallStatus.equals(CallStatus.IN_CONVERSATION)) {