forked from melod1n/fast-messenger
account's info on profile screen; storing users into cache
This commit is contained in:
@@ -9,7 +9,7 @@ data class UsersGetRequest(
|
||||
val map
|
||||
get() = mutableMapOf<String, String>()
|
||||
.apply {
|
||||
userIds?.let { this["user_ids"] = it.joinToString() }
|
||||
userIds?.let { this["user_ids"] = it.joinToString(",") }
|
||||
fields?.let { this["fields"] = it }
|
||||
nomCase?.let { this["nom_case"] = it }
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.meloda.app.fast.model.database
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.meloda.app.fast.model.api.domain.OnlineStatus
|
||||
import com.meloda.app.fast.model.api.domain.VkUser
|
||||
|
||||
@Entity(tableName = "users")
|
||||
data class VkUserEntity(
|
||||
@@ -18,3 +20,20 @@ data class VkUserEntity(
|
||||
val photo100: String?,
|
||||
val photo200: String?
|
||||
)
|
||||
|
||||
fun VkUserEntity.asExternalModel(): VkUser = VkUser(
|
||||
id = id,
|
||||
firstName = firstName,
|
||||
lastName = lastName,
|
||||
onlineStatus = when {
|
||||
!isOnline -> OnlineStatus.Offline
|
||||
!isOnlineMobile -> OnlineStatus.Online(onlineAppId)
|
||||
else -> OnlineStatus.OnlineMobile(onlineAppId)
|
||||
},
|
||||
photo50 = photo50,
|
||||
photo100 = photo100,
|
||||
photo200 = photo200,
|
||||
lastSeen = lastSeen,
|
||||
lastSeenStatus = lastSeenStatus,
|
||||
birthday = birthday
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user