mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 22:29:09 +00:00
Add UserIdUtils for generic no primary key situation handling
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
1cec9045ee
commit
c4c183ac39
15
app/src/main/java/com/nextcloud/talk/utils/UserIdUtils.kt
Normal file
15
app/src/main/java/com/nextcloud/talk/utils/UserIdUtils.kt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package com.nextcloud.talk.utils
|
||||||
|
|
||||||
|
import com.nextcloud.talk.data.user.model.User
|
||||||
|
|
||||||
|
object UserIdUtils {
|
||||||
|
private const val NO_ID: Long = -1
|
||||||
|
|
||||||
|
fun getIdForUser(user: User?): Long {
|
||||||
|
return if (user?.id != null) {
|
||||||
|
user.id!!
|
||||||
|
} else {
|
||||||
|
NO_ID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user