From 88298026aad915a2dc620c3f097f6862c377d91f Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Tue, 11 Dec 2018 13:14:57 +0100 Subject: [PATCH] Fix push Signed-off-by: Mario Danic --- .../java/com/nextcloud/talk/controllers/ChatController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java index 416282817..43221682b 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java @@ -507,6 +507,7 @@ public class ChatController extends BaseController implements MessagesListAdapte NotificationUtils.cancelExistingNotifications(getApplicationContext(), conversationUser); if (wasDetached & conversationUser.hasSpreedCapabilityWithName("no-ping")) { + wasDetached = false; joinRoomWithPassword(); } } @@ -517,6 +518,7 @@ public class ChatController extends BaseController implements MessagesListAdapte super.onDetach(view); if (conversationUser.hasSpreedCapabilityWithName("no-ping")) { wasDetached = true; + leaveRoom(); } } @@ -588,8 +590,6 @@ public class ChatController extends BaseController implements MessagesListAdapte private void joinRoomWithPassword() { - wasDetached = false; - if (currentCall == null) { ncApi.joinRoom(credentials, ApiUtils.getUrlForSettingMyselfAsActiveParticipant(baseUrl, roomToken), roomPassword) .subscribeOn(Schedulers.newThread()) @@ -653,7 +653,7 @@ public class ChatController extends BaseController implements MessagesListAdapte @Override public void onNext(GenericOverall genericOverall) { dispose(); - if (!isDestroyed() && !isBeingDestroyed()) { + if (!isDestroyed() && !isBeingDestroyed() && !wasDetached) { getRouter().popCurrentController(); } }