mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 01:24:03 +03:00
UsersDao/Repository: get rid of suspend functions
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
f339648875
commit
0ac26f557b
3 changed files with 6 additions and 6 deletions
|
@ -99,7 +99,7 @@ abstract class UsersDao {
|
|||
}
|
||||
|
||||
@Transaction
|
||||
open suspend fun markUserForDeletion(id: Long): Boolean {
|
||||
open fun markUserForDeletion(id: Long): Boolean {
|
||||
getUserWithId(id).blockingGet()?.let { user ->
|
||||
user.current = FALSE
|
||||
updateUser(user)
|
||||
|
@ -109,7 +109,7 @@ abstract class UsersDao {
|
|||
}
|
||||
|
||||
@Transaction
|
||||
open suspend fun setAnyUserAsActive(): Boolean {
|
||||
open fun setAnyUserAsActive(): Boolean {
|
||||
val users = getUsers().blockingGet()
|
||||
|
||||
val result = users.firstOrNull()?.let { user ->
|
||||
|
|
|
@ -41,6 +41,6 @@ interface UsersRepository {
|
|||
fun insertUser(user: User): Long
|
||||
fun setUserAsActiveWithId(id: Long): Single<Boolean>
|
||||
fun deleteUserWithId(id: Long)
|
||||
suspend fun setAnyUserAsActive(): Boolean
|
||||
suspend fun markUserForDeletion(id: Long): Boolean
|
||||
fun setAnyUserAsActive(): Boolean
|
||||
fun markUserForDeletion(id: Long): Boolean
|
||||
}
|
||||
|
|
|
@ -81,11 +81,11 @@ class UsersRepositoryImpl(private val usersDao: UsersDao) : UsersRepository {
|
|||
usersDao.deleteUserWithId(id)
|
||||
}
|
||||
|
||||
override suspend fun setAnyUserAsActive(): Boolean {
|
||||
override fun setAnyUserAsActive(): Boolean {
|
||||
return usersDao.setAnyUserAsActive()
|
||||
}
|
||||
|
||||
override suspend fun markUserForDeletion(id: Long): Boolean {
|
||||
override fun markUserForDeletion(id: Long): Boolean {
|
||||
return usersDao.markUserForDeletion(id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue