srctree

Robin Linden parent ea2831ab 7bc19443
Fix possible ANR when e.g. leaving the chat view during bootstrapping

This triggers a synchronous call from the main thread into Tox to changethe selfTyping status which will try to take the same mutex thatbootstrapping might be holding during a call into things that donetworking.

inlinesplit
domain/src/main/kotlin/feature/ChatManager.kt added: 5, removed: 3, total 2
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2021 aTox contributors
// SPDX-FileCopyrightText: 2019-2024 Robin Lindén <dev@robinlinden.eu>
//
// SPDX-License-Identifier: GPL-3.0-only
 
@@ -108,5 +108,7 @@ class ChatManager @Inject constructor(
contactRepository.setLastMessage(publicKey.string(), 0)
}
 
fun setTyping(publicKey: PublicKey, typing: Boolean) = tox.setTyping(publicKey, typing)
fun setTyping(publicKey: PublicKey, typing: Boolean) = scope.launch {
tox.setTyping(publicKey, typing)
}
}