From fb7ea25b9df88447551d86b44991f1a68d4f27c5 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Fri, 10 Feb 2023 16:13:46 +0100 Subject: [PATCH] Fix to switch active user when opening talk from notification When two or more users were setup, the active user was not updated when opening the app from notification. As a result, it was not possible to send files, mention people... Signed-off-by: Marcel Hibbe --- .../java/com/nextcloud/talk/activities/MainActivity.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt b/app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt index f0dcf32cb..f8571b6c5 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt @@ -338,6 +338,14 @@ class MainActivity : BaseActivity(), ActionBarProvider { override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) Log.d(TAG, "onNewIntent Activity: " + System.identityHashCode(this).toString()) + + val user = intent.getParcelableExtra(KEY_USER_ENTITY) + if (user != null && userManager.setUserAsActive(user).blockingGet()) { + handleIntent(intent) + } + } + + private fun handleIntent(intent: Intent) { handleActionFromContact(intent) if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) { if (intent.getBooleanExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL, false)) {