mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-29 00:19:44 +01:00
open chat when navigating back from thread
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
abf15ae2f2
commit
c468ba4df6
@ -393,9 +393,14 @@ class ChatActivity :
|
||||
|
||||
private val onBackPressedCallback = object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
val intent = Intent(this@ChatActivity, ConversationsListActivity::class.java)
|
||||
intent.putExtras(Bundle())
|
||||
startActivity(intent)
|
||||
if (isChatThread()) {
|
||||
isEnabled = false
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
} else {
|
||||
val intent = Intent(this@ChatActivity, ConversationsListActivity::class.java)
|
||||
intent.putExtras(Bundle())
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2603,7 +2608,7 @@ class ChatActivity :
|
||||
viewThemeUtils.platform.colorTextView(title, ColorRole.ON_SURFACE)
|
||||
|
||||
title.text =
|
||||
if (threadId != null && threadId!! > 0) {
|
||||
if (isChatThread()) {
|
||||
"Thread $threadId"
|
||||
} else if (currentConversation?.displayName != null) {
|
||||
try {
|
||||
@ -4118,6 +4123,8 @@ class ChatActivity :
|
||||
}
|
||||
}
|
||||
|
||||
private fun isChatThread(): Boolean = threadId != null && threadId!! > 0
|
||||
|
||||
fun openThread(roomToken: String, threadId: Long) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ROOM_TOKEN, roomToken)
|
||||
|
Loading…
Reference in New Issue
Block a user