Browse Source

set user.current by value from userAttributes

this should have no effect but it should ensure "current" is not falsely set to true if the method storeProfile will be used for more scenarios in the future.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 2 years ago
parent
commit
e9dbcc554a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/src/main/java/com/nextcloud/talk/users/UserManager.kt

+ 2 - 2
app/src/main/java/com/nextcloud/talk/users/UserManager.kt

@@ -149,7 +149,7 @@ class UserManager internal constructor(private val userRepository: UsersReposito
                     else -> {
                         user.token = userAttributes.token
                         user.baseUrl = userAttributes.serverUrl
-                        user.current = true
+                        user.current = userAttributes.currentUser
                         user.userId = userAttributes.userId
                         user.token = userAttributes.token
                         user.displayName = userAttributes.displayName
@@ -237,7 +237,7 @@ class UserManager internal constructor(private val userRepository: UsersReposito
     data class UserAttributes(
         val id: Long?,
         val serverUrl: String?,
-        val currentUser: Boolean?,
+        val currentUser: Boolean,
         val userId: String?,
         val token: String?,
         val displayName: String?,