Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-06-12 20:30:13 +02:00
parent 60f2e25007
commit 2438a09fd0

View File

@ -147,15 +147,20 @@ public class CallNotificationController extends BaseController {
@Override
public void onNext(ParticipantsOverall participantsOverall) {
boolean hasParticipantsInCall = false;
boolean inCallOnDifferentDevice = false;
List<Participant> participantList = participantsOverall.getOcs().getData();
for (Participant participant : participantList) {
if (participant.isInCall()) {
hasParticipantsInCall = true;
if (participant.getUserId().equals(userBeingCalled.getUserId())) {
inCallOnDifferentDevice = true;
}
break;
}
}
if (!hasParticipantsInCall) {
if (!hasParticipantsInCall || inCallOnDifferentDevice) {
if (getActivity() != null) {
getActivity().runOnUiThread(() -> hangup());
}