mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 17:08:34 +03:00
Merge pull request #2484 from nextcloud/fix-computing-new-sessions-in-call
Fix computing new sessions in call
This commit is contained in:
commit
a17acc779c
1 changed files with 5 additions and 7 deletions
|
@ -1851,17 +1851,14 @@ public class CallActivity extends CallBaseActivity {
|
||||||
for (HashMap<String, Object> participant : users) {
|
for (HashMap<String, Object> participant : users) {
|
||||||
long inCallFlag = (long) participant.get("inCall");
|
long inCallFlag = (long) participant.get("inCall");
|
||||||
if (!participant.get("sessionId").equals(currentSessionId)) {
|
if (!participant.get("sessionId").equals(currentSessionId)) {
|
||||||
boolean isNewSession;
|
|
||||||
Log.d(TAG, " inCallFlag of participant "
|
Log.d(TAG, " inCallFlag of participant "
|
||||||
+ participant.get("sessionId").toString().substring(0, 4)
|
+ participant.get("sessionId").toString().substring(0, 4)
|
||||||
+ " : "
|
+ " : "
|
||||||
+ inCallFlag);
|
+ inCallFlag);
|
||||||
isNewSession = inCallFlag != 0;
|
|
||||||
|
|
||||||
if (isNewSession) {
|
boolean isInCall = inCallFlag != 0;
|
||||||
|
if (isInCall) {
|
||||||
newSessions.add(participant.get("sessionId").toString());
|
newSessions.add(participant.get("sessionId").toString());
|
||||||
} else {
|
|
||||||
oldSessions.add(participant.get("sessionId").toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The property is "userId" when not using the external signaling server and "userid" when using it.
|
// The property is "userId" when not using the external signaling server and "userid" when using it.
|
||||||
|
@ -1888,7 +1885,8 @@ public class CallActivity extends CallBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate sessions that left the call
|
// Calculate sessions that left the call
|
||||||
oldSessions.removeAll(newSessions);
|
List<String> disconnectedSessions = new ArrayList<>(oldSessions);
|
||||||
|
disconnectedSessions.removeAll(newSessions);
|
||||||
|
|
||||||
// Calculate sessions that join the call
|
// Calculate sessions that join the call
|
||||||
newSessions.removeAll(oldSessions);
|
newSessions.removeAll(oldSessions);
|
||||||
|
@ -1926,7 +1924,7 @@ public class CallActivity extends CallBaseActivity {
|
||||||
setCallState(CallStatus.IN_CONVERSATION);
|
setCallState(CallStatus.IN_CONVERSATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String sessionId : oldSessions) {
|
for (String sessionId : disconnectedSessions) {
|
||||||
Log.d(TAG, " oldSession that will be removed is: " + sessionId);
|
Log.d(TAG, " oldSession that will be removed is: " + sessionId);
|
||||||
endPeerConnection(sessionId, false);
|
endPeerConnection(sessionId, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue