remove KEY_OPEN_CHAT

this was temporarily used until now Chat is an Activity

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2023-04-02 20:55:15 +02:00
parent d42783273d
commit 63b2455745
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
3 changed files with 13 additions and 50 deletions

View file

@ -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<User>(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()) {

View file

@ -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) {

View file

@ -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
}