mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-17 01:35:03 +01:00
Get participants update to work
This commit is contained in:
parent
db026c4a9e
commit
83a91539fb
@ -1024,7 +1024,7 @@ public class CallController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void joinRoomAndCall() {
|
private void joinRoomAndCall() {
|
||||||
if ("0".equals(callSession) || externalSignalingServer != null) {
|
if ("0".equals(callSession)) {
|
||||||
ncApi.joinRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl, roomToken), null)
|
ncApi.joinRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl, roomToken), null)
|
||||||
.subscribeOn(Schedulers.newThread())
|
.subscribeOn(Schedulers.newThread())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@ -1037,12 +1037,8 @@ public class CallController extends BaseController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(CallOverall callOverall) {
|
public void onNext(CallOverall callOverall) {
|
||||||
if (externalSignalingServer == null) {
|
callSession = callOverall.getOcs().getData().getSessionId();
|
||||||
callSession = callOverall.getOcs().getData().getSessionId();
|
callOrJoinRoomViaWebSocket();
|
||||||
performCall();
|
|
||||||
} else {
|
|
||||||
webSocketClient.joinRoomWithRoomToken(roomToken);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1056,7 +1052,15 @@ public class CallController extends BaseController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
callOrJoinRoomViaWebSocket();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void callOrJoinRoomViaWebSocket() {
|
||||||
|
if (externalSignalingServer == null) {
|
||||||
performCall();
|
performCall();
|
||||||
|
} else {
|
||||||
|
webSocketClient.joinRoomWithRoomTokenAndSession(roomToken, callSession);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1171,7 +1175,7 @@ public class CallController extends BaseController {
|
|||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
alwaysGetPeerConnectionWrapperForSessionId(callSession, true);
|
alwaysGetPeerConnectionWrapperForSessionId(webSocketClient.getSessionId(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1197,7 +1201,6 @@ public class CallController extends BaseController {
|
|||||||
public void onMessageEvent(WebSocketCommunicationEvent webSocketCommunicationEvent) {
|
public void onMessageEvent(WebSocketCommunicationEvent webSocketCommunicationEvent) {
|
||||||
switch (webSocketCommunicationEvent.getType()) {
|
switch (webSocketCommunicationEvent.getType()) {
|
||||||
case "hello":
|
case "hello":
|
||||||
callSession = webSocketClient.getSessionId();
|
|
||||||
joinRoomAndCall();
|
joinRoomAndCall();
|
||||||
break;
|
break;
|
||||||
case "roomJoined":
|
case "roomJoined":
|
||||||
@ -1373,7 +1376,7 @@ public class CallController extends BaseController {
|
|||||||
@Override
|
@Override
|
||||||
public void onNext(GenericOverall genericOverall) {
|
public void onNext(GenericOverall genericOverall) {
|
||||||
if (externalSignalingServer != null) {
|
if (externalSignalingServer != null) {
|
||||||
webSocketClient.joinRoomWithRoomToken("");
|
webSocketClient.joinRoomWithRoomTokenAndSession("", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMultiSession) {
|
if (isMultiSession) {
|
||||||
@ -1455,11 +1458,7 @@ public class CallController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (MagicPeerConnectionWrapper magicPeerConnectionWrapper : magicPeerConnectionWrapperList) {
|
for (MagicPeerConnectionWrapper magicPeerConnectionWrapper : magicPeerConnectionWrapperList) {
|
||||||
if (externalSignalingServer != null && callSession.equals(magicPeerConnectionWrapper.getSessionId())) {
|
oldSesssions.add(magicPeerConnectionWrapper.getSessionId());
|
||||||
oldSesssions.add(magicPeerConnectionWrapper.getSessionId());
|
|
||||||
} else {
|
|
||||||
oldSesssions.add(magicPeerConnectionWrapper.getSessionId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate sessions that left the call
|
// Calculate sessions that left the call
|
||||||
@ -1716,6 +1715,7 @@ public class CallController extends BaseController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Log.d("MARIO", "SENDING CALL MESSAGE " + ncMessageWrapper.getSignalingMessage().getType());
|
||||||
webSocketClient.sendCallMessage(ncMessageWrapper);
|
webSocketClient.sendCallMessage(ncMessageWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,9 +202,9 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
|||||||
return hasMCU;
|
return hasMCU;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void joinRoomWithRoomToken(String roomToken) {
|
public void joinRoomWithRoomTokenAndSession(String roomToken, String normalBackendSession) {
|
||||||
try {
|
try {
|
||||||
webSocket.send(LoganSquare.serialize(webSocketConnectionHelper.getAssembledJoinOrLeaveRoomModel(roomToken, sessionId)));
|
webSocket.send(LoganSquare.serialize(webSocketConnectionHelper.getAssembledJoinOrLeaveRoomModel(roomToken, normalBackendSession)));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(TAG, "Failed to serialize room overall websocket message");
|
Log.e(TAG, "Failed to serialize room overall websocket message");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user