瀏覽代碼

Fix #82

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 年之前
父節點
當前提交
2438a09fd0
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java

+ 6 - 1
app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java

@@ -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());
                             }