mirror of
https://github.com/nextcloud/talk-android
synced 2025-08-07 03:55:50 +01:00
open chat when navigating back from thread
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
6a4f66d9be
commit
75d3b18352
@ -393,8 +393,14 @@ class ChatActivity :
|
||||
|
||||
private val onBackPressedCallback = object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
val intent = Intent(this@ChatActivity, ConversationsListActivity::class.java)
|
||||
startActivity(intent)
|
||||
if (isChatThread()) {
|
||||
isEnabled = false
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
} else {
|
||||
val intent = Intent(this@ChatActivity, ConversationsListActivity::class.java)
|
||||
intent.putExtras(Bundle())
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2604,7 +2610,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 {
|
||||
@ -4119,6 +4125,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