All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.sceyt.chatuikit.data.models.messages.SceytUser.kt Maven / Gradle / Ivy

There is a newer version: 1.7.2
Show newest version
package com.sceyt.chatuikit.data.models.messages

import android.os.Parcelable
import com.sceyt.chat.models.user.Presence
import com.sceyt.chat.models.user.UserState
import kotlinx.parcelize.Parcelize

@Parcelize
data class SceytUser(
        val id: String,
        val username: String,
        val firstName: String,
        val lastName: String,
        val avatarURL: String?,
        val metadataMap: Map?,
        val presence: Presence?,
        val state: UserState,
        val blocked: Boolean
) : Parcelable {

    val fullName: String
        get() = "$firstName $lastName".trim()

    constructor(id: String) : this(
        id = id,
        username = "",
        firstName = "",
        lastName = "",
        avatarURL = null,
        metadataMap = null,
        presence = null,
        state = UserState.Active,
        blocked = false)

    override fun equals(other: Any?): Boolean {
        return other is SceytUser && id == other.id
    }

    override fun hashCode(): Int {
        return id.hashCode()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy