mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-13 15:54:59 +01:00
Rewrite if/else chain as if/return blocks
Just a matter of preference :-) Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
04f1679e2a
commit
34498efa72
@ -2704,13 +2704,25 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
if (iceConnectionState == PeerConnection.IceConnectionState.CONNECTED ||
|
if (iceConnectionState == PeerConnection.IceConnectionState.CONNECTED ||
|
||||||
iceConnectionState == PeerConnection.IceConnectionState.COMPLETED) {
|
iceConnectionState == PeerConnection.IceConnectionState.COMPLETED) {
|
||||||
handlePeerConnected(sessionId, videoStreamType);
|
handlePeerConnected(sessionId, videoStreamType);
|
||||||
} else if (iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED ||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED ||
|
||||||
iceConnectionState == PeerConnection.IceConnectionState.NEW ||
|
iceConnectionState == PeerConnection.IceConnectionState.NEW ||
|
||||||
iceConnectionState == PeerConnection.IceConnectionState.CHECKING) {
|
iceConnectionState == PeerConnection.IceConnectionState.CHECKING) {
|
||||||
handlePeerDisconnected(sessionId, videoStreamType);
|
handlePeerDisconnected(sessionId, videoStreamType);
|
||||||
} else if (iceConnectionState == PeerConnection.IceConnectionState.CLOSED) {
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iceConnectionState == PeerConnection.IceConnectionState.CLOSED) {
|
||||||
endPeerConnection(sessionId, VIDEO_STREAM_TYPE_SCREEN.equals(videoStreamType));
|
endPeerConnection(sessionId, VIDEO_STREAM_TYPE_SCREEN.equals(videoStreamType));
|
||||||
} else if (iceConnectionState == PeerConnection.IceConnectionState.FAILED) {
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iceConnectionState == PeerConnection.IceConnectionState.FAILED) {
|
||||||
if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) {
|
if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) {
|
||||||
setCallState(CallStatus.PUBLISHER_FAILED);
|
setCallState(CallStatus.PUBLISHER_FAILED);
|
||||||
webSocketClient.clearResumeId();
|
webSocketClient.clearResumeId();
|
||||||
@ -2718,6 +2730,8 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
} else {
|
} else {
|
||||||
handlePeerDisconnected(sessionId, videoStreamType);
|
handlePeerDisconnected(sessionId, videoStreamType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user