srctree

Robin Linden parent 63aa0a43 c5874fb5
Move stopping Tox into the ToxStarter class

inlinesplit
atox/src/main/kotlin/tox/ToxStarter.kt added: 7, removed: 5, total 2
@@ -32,6 +32,10 @@ class ToxStarter @Inject constructor(
false
}
 
fun stopTox() = context.run {
stopService(Intent(this, ToxService::class.java))
}
 
fun tryLoadTox(): Boolean {
tryLoadSave()?.also { save ->
startTox(save)
 
atox/src/main/kotlin/ui/contactlist/ContactListViewModel.kt added: 7, removed: 5, total 2
@@ -37,9 +37,7 @@ class ContactListViewModel @Inject constructor(
 
fun isToxRunning() = tox.started
fun tryLoadTox(): Boolean = toxStarter.tryLoadTox()
fun quitTox() = context.run {
stopService(Intent(this, ToxService::class.java))
}
fun quitTox() = toxStarter.stopTox()
 
fun acceptFriendRequest(friendRequest: FriendRequest) = friendRequestManager.accept(friendRequest)
fun rejectFriendRequest(friendRequest: FriendRequest) = friendRequestManager.reject(friendRequest)