From 0aa79f494096ef799dc3d12b8e83832e60b06a88 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Tue, 29 May 2018 14:09:47 +0200 Subject: [PATCH] Revert "Fix bugs" This reverts commit a88aaf5e66b9fba8d9ec5ba5f3e147fa041d570b. --- .../talk/activities/CallActivity.java | 58 +++++++++---------- .../nextcloud/talk/jobs/NotificationJob.java | 2 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 859de7e60..80f6fdea4 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -289,7 +289,7 @@ public class CallActivity extends AppCompatActivity { Log.e(TAG, "Failed to evict cache"); } - if (getIntent().getExtras().containsKey(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) { + if (getIntent().getExtras().containsKey(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) { handleFromNotification(); } else { initViews(); @@ -940,38 +940,38 @@ public class CallActivity extends AppCompatActivity { ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId); ApplicationWideCurrentRoomHolder.getInstance().setInCall(true); ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(userEntity); + + ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(baseUrl, roomToken)) + .subscribeOn(Schedulers.newThread()) + .observeOn(AndroidSchedulers.mainThread()) + .repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS)) + .takeWhile(observable -> inCall) + .retry(3, observable -> inCall) + .subscribe(new Observer() { + @Override + public void onSubscribe(Disposable d) { + pingDisposable = d; + } + + @Override + public void onNext(GenericOverall genericOverall) { + + } + + @Override + public void onError(Throwable e) { + dispose(pingDisposable); + } + + @Override + public void onComplete() { + dispose(pingDisposable); + } + }); } else { ApplicationWideCurrentRoomHolder.getInstance().setInCall(true); } - ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(baseUrl, roomToken)) - .subscribeOn(Schedulers.newThread()) - .observeOn(AndroidSchedulers.mainThread()) - .repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS)) - .takeWhile(observable -> inCall) - .retry(3, observable -> inCall) - .subscribe(new Observer() { - @Override - public void onSubscribe(Disposable d) { - pingDisposable = d; - } - - @Override - public void onNext(GenericOverall genericOverall) { - - } - - @Override - public void onError(Throwable e) { - dispose(pingDisposable); - } - - @Override - public void onComplete() { - dispose(pingDisposable); - } - }); - // Start pulling signaling messages String urlToken = null; if (isMultiSession) { diff --git a/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java b/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java index 0c0054653..f16f2d076 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java @@ -110,7 +110,7 @@ public class NotificationJob extends Job { .getInstance().getUserInRoom()); boolean shouldShowNotification = decryptedPushMessage.getApp().equals("spreed") && - (!isInTheSameRoomAsNotification || decryptedPushMessage.getType().equals("call")); + !(isInTheSameRoomAsNotification && !decryptedPushMessage.getType().equals("call")); if (shouldShowNotification) { int smallIcon;