mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
simplify call logic
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
480122d648
commit
96910c02a1
@ -124,10 +124,11 @@ class UserManager internal constructor(private val userRepository: UsersReposito
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun updateUser(user: User): Single<Int> {
|
fun updateUser(user: User): Single<Int> {
|
||||||
return if (user.id != null) {
|
return Single.fromCallable {
|
||||||
Single.just(userRepository.updateUser(user))
|
when (user.id) {
|
||||||
} else {
|
null -> userRepository.insertUser(user).toInt()
|
||||||
Single.just(userRepository.insertUser(user).toInt())
|
else -> userRepository.updateUser(user)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user