User

@Immutable
data class User(val id: String = "", val role: String = "", val name: String = "", val image: String = "", val invisible: Boolean? = null, val privacySettings: PrivacySettings? = null, val language: String = "", val banned: Boolean? = null, val devices: List<Device> = listOf(), val online: Boolean = false, val createdAt: Date? = null, val updatedAt: Date? = null, val lastActive: Date? = null, val totalUnreadCount: Int = 0, val unreadChannels: Int = 0, val unreadThreads: Int = 0, val mutes: List<Mute> = listOf(), val teams: List<String> = listOf(), val channelMutes: List<ChannelMute> = emptyList(), val extraData: Map<String, Any> = mapOf(), val deactivatedAt: Date? = null) : CustomObject, ComparableFieldProvider

Represents a person who uses a chat and can perform chat operations like viewing channels or sending messages.

Parameters

id

The unique id of the user. This field if required.

role

Determines the set of user permissions.

name

User's name.

image

User's image.

invisible

Determines if the user should share its online status. Can only be changed while connecting the user.

privacySettings

The privacy settings for the user.

banned

Whether a user is banned or not.

devices

The list of devices for the current user.

online

Whether a is user online or not.

createdAt

Date/time of creation.

updatedAt

Date/time of the last update.

lastActive

Date of last activity.

totalUnreadCount

The total unread messages count for the current user.

unreadChannels

The total unread channels count for the current user.

unreadThreads

The total number of unread threads for the current user.

mutes

A list of users muted by the current user.

teams

List of teams user is a part of.

channelMutes

A list of channels muted by the current user.

extraData

A map of custom fields for the user.

deactivatedAt

Date/time of deactivation.

Constructors

Link copied to clipboard
constructor(id: String = "", role: String = "", name: String = "", image: String = "", invisible: Boolean? = null, privacySettings: PrivacySettings? = null, language: String = "", banned: Boolean? = null, devices: List<Device> = listOf(), online: Boolean = false, createdAt: Date? = null, updatedAt: Date? = null, lastActive: Date? = null, totalUnreadCount: Int = 0, unreadChannels: Int = 0, unreadThreads: Int = 0, mutes: List<Mute> = listOf(), teams: List<String> = listOf(), channelMutes: List<ChannelMute> = emptyList(), extraData: Map<String, Any> = mapOf(), deactivatedAt: Date? = null)

Types

Link copied to clipboard
class Builder

Properties

Link copied to clipboard
val banned: Boolean? = null
Link copied to clipboard
Link copied to clipboard
val createdAt: Date? = null
Link copied to clipboard
val deactivatedAt: Date? = null
Link copied to clipboard
Link copied to clipboard
open override val extraData: Map<String, Any>
Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
val invisible: Boolean? = null
Link copied to clipboard

Determines if the user is banned or not.

Link copied to clipboard

Determines if the user should share its online status.

Link copied to clipboard

Determines if the user has read receipts enabled.

Link copied to clipboard

Determines if the user has typing indicators enabled.

Link copied to clipboard
Link copied to clipboard
val lastActive: Date? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val online: Boolean = false
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val updatedAt: Date? = null

Functions

Link copied to clipboard
open override fun getComparableField(fieldName: String): Comparable<*>?

Gets a comparable fields from a name.

Link copied to clipboard

Inherited functions

Link copied to clipboard
open fun <T> getExtraValue(key: String, default: T): T