mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 22:04:24 +01:00
remove scope cancelation for handleChatOnBackPress (replace with lifecyle event)
handleOnStop will handle this (and more scenarios than just backpress) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
1f105d44d3
commit
9b6b01254a
@ -348,7 +348,6 @@ class ChatActivity :
|
|||||||
|
|
||||||
private val onBackPressedCallback = object : OnBackPressedCallback(true) {
|
private val onBackPressedCallback = object : OnBackPressedCallback(true) {
|
||||||
override fun handleOnBackPressed() {
|
override fun handleOnBackPressed() {
|
||||||
chatViewModel.handleChatOnBackPress()
|
|
||||||
if (currentlyPlayedVoiceMessage != null) {
|
if (currentlyPlayedVoiceMessage != null) {
|
||||||
stopMediaPlayer(currentlyPlayedVoiceMessage!!)
|
stopMediaPlayer(currentlyPlayedVoiceMessage!!)
|
||||||
}
|
}
|
||||||
|
@ -74,11 +74,6 @@ interface ChatMessageRepository : LifecycleAwareManager {
|
|||||||
*/
|
*/
|
||||||
suspend fun getMessage(messageId: Long, bundle: Bundle): Flow<ChatMessage>
|
suspend fun getMessage(messageId: Long, bundle: Bundle): Flow<ChatMessage>
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroys unused resources.
|
|
||||||
*/
|
|
||||||
fun handleChatOnBackPress()
|
|
||||||
|
|
||||||
@Suppress("LongParameterList")
|
@Suppress("LongParameterList")
|
||||||
suspend fun sendChatMessage(
|
suspend fun sendChatMessage(
|
||||||
credentials: String,
|
credentials: String,
|
||||||
|
@ -806,10 +806,6 @@ class OfflineFirstChatRepository @Inject constructor(
|
|||||||
scope.cancel()
|
scope.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handleChatOnBackPress() {
|
|
||||||
scope.cancel()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("LongParameterList")
|
@Suppress("LongParameterList")
|
||||||
override suspend fun sendChatMessage(
|
override suspend fun sendChatMessage(
|
||||||
credentials: String,
|
credentials: String,
|
||||||
|
@ -647,10 +647,6 @@ class ChatViewModel @Inject constructor(
|
|||||||
_getCapabilitiesViewState.value = GetCapabilitiesStartState
|
_getCapabilitiesViewState.value = GetCapabilitiesStartState
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleChatOnBackPress() {
|
|
||||||
chatRepository.handleChatOnBackPress()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getMessageById(url: String, conversationModel: ConversationModel, messageId: Long): Flow<ChatMessage> =
|
fun getMessageById(url: String, conversationModel: ConversationModel, messageId: Long): Flow<ChatMessage> =
|
||||||
flow {
|
flow {
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
|
Loading…
Reference in New Issue
Block a user