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 a98899fb3..b89204974 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt @@ -93,25 +93,6 @@ class MainActivity : BaseActivity(), ActionBarProvider { router = Conductor.attachRouter(this, binding.controllerContainer, savedInstanceState) - // TODO: delete this. open chats directly via intent - if (intent.getBooleanExtra(BundleKeys.KEY_OPEN_CHAT, false)) { - logRouterBackStack(router!!) - // remapChatController( - // router!!, - // intent.getParcelableExtra(KEY_USER_ENTITY)!!.id!!, - // intent.getStringExtra(KEY_ROOM_TOKEN)!!, - // intent.extras!!, - // true, - // true - // ) - - val chatIntent = Intent(context, ChatActivity::class.java) - chatIntent.putExtras(intent.extras!!) - startActivity(chatIntent) - - logRouterBackStack(router!!) - } - if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) { onNewIntent(intent) } else if (!router!!.hasRootController()) { diff --git a/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt index 74c128dde..1052cc12b 100644 --- a/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt @@ -46,11 +46,11 @@ import autodagger.AutoInjector import com.bluelinelabs.logansquare.LoganSquare import com.nextcloud.talk.R import com.nextcloud.talk.activities.BaseActivity -import com.nextcloud.talk.activities.MainActivity import com.nextcloud.talk.adapters.items.ContactItem import com.nextcloud.talk.adapters.items.GenericTextHeaderItem import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication +import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.controllers.bottomsheet.ConversationOperationEnum import com.nextcloud.talk.data.user.model.User import com.nextcloud.talk.databinding.ControllerContactsRvBinding @@ -68,7 +68,6 @@ import com.nextcloud.talk.users.UserManager import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DisplayUtils import com.nextcloud.talk.utils.bundle.BundleKeys -import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_OPEN_CHAT import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.SelectableAdapter @@ -376,12 +375,10 @@ class ContactsActivity : Parcels.wrap(roomOverall.ocs!!.data!!) ) - // TODO: go directly to ChatActivity when conductor is removed - bundle.putBoolean(KEY_OPEN_CHAT, true) - val intent = Intent(context, MainActivity::class.java) - intent.putExtras(bundle) - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - startActivity(intent) + val chatIntent = Intent(context, ChatActivity::class.java) + chatIntent.putExtras(bundle) + chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) + startActivity(chatIntent) } override fun onError(e: Throwable) { @@ -759,23 +756,11 @@ class ContactsActivity : @Subscribe(threadMode = ThreadMode.MAIN) fun onMessageEvent(openConversationEvent: OpenConversationEvent) { - // ConductorRemapping.remapChatController( - // router, - // currentUser!!.id!!, - // openConversationEvent.conversation!!.token!!, - // openConversationEvent.bundle!!, - // true - // ) + val chatIntent = Intent(context, ChatActivity::class.java) + chatIntent.putExtras(openConversationEvent.bundle!!) + chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) + startActivity(chatIntent) - // TODO: go directly to ChatActivity when conductor is removed - - var bundle = openConversationEvent.bundle!! - - bundle.putBoolean(KEY_OPEN_CHAT, true) - val intent = Intent(context, MainActivity::class.java) - intent.putExtras(bundle) - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - startActivity(intent) contactsBottomDialog?.dismiss() } @@ -847,12 +832,10 @@ class ContactsActivity : Parcels.wrap(roomOverall.ocs!!.data!!) ) - // TODO: go directly to ChatActivity when conductor is removed - bundle.putBoolean(KEY_OPEN_CHAT, true) - val intent = Intent(context, MainActivity::class.java) - intent.putExtras(bundle) - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - startActivity(intent) + val chatIntent = Intent(context, ChatActivity::class.java) + chatIntent.putExtras(bundle) + chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) + startActivity(chatIntent) } override fun onError(e: Throwable) { diff --git a/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt b/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt index 611a1093c..4b643b1ed 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt @@ -86,5 +86,4 @@ object BundleKeys { const val KEY_DISMISS_RECORDING_URL = "KEY_DISMISS_RECORDING_URL" const val KEY_SHARE_RECORDING_TO_CHAT_URL = "KEY_SHARE_RECORDING_TO_CHAT_URL" const val KEY_GEOCODING_RESULT = "KEY_GEOCODING_RESULT" - const val KEY_OPEN_CHAT = "KEY_OPEN_CHAT" // just temporarily used until conductor is deleted }