User

data class User(    var id: String = "",     var role: String = "",     var name: String = "",     var image: String = "",     var invisible: Boolean = false,     var banned: Boolean = false,     var devices: List<Device> = mutableListOf(),     var online: Boolean = false,     var createdAt: Date? = null,     var updatedAt: Date? = null,     var lastActive: Date? = null,     var totalUnreadCount: Int = 0,     var unreadChannels: Int = 0,     var mutes: List<Mute> = mutableListOf(),     val teams: List<String> = listOf(),     val channelMutes: List<ChannelMute> = emptyList(),     var extraData: MutableMap<String, Any> = mutableMapOf()) : 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.

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.

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.

Constructors

Link copied to clipboard
fun User(    id: String = "",     role: String = "",     name: String = "",     image: String = "",     invisible: Boolean = false,     banned: Boolean = false,     devices: List<Device> = mutableListOf(),     online: Boolean = false,     createdAt: Date? = null,     updatedAt: Date? = null,     lastActive: Date? = null,     totalUnreadCount: Int = 0,     unreadChannels: Int = 0,     mutes: List<Mute> = mutableListOf(),     teams: List<String> = listOf(),     channelMutes: List<ChannelMute> = emptyList(),     extraData: MutableMap<String, Any> = mutableMapOf())

Properties

Link copied to clipboard
var banned: Boolean = false
Link copied to clipboard
val channelMutes: List<ChannelMute>
Link copied to clipboard
var createdAt: Date? = null
Link copied to clipboard
var devices: List<Device>
Link copied to clipboard
open override var extraData: MutableMap<String, Any>
Link copied to clipboard
var id: String
Link copied to clipboard
var image: String
Link copied to clipboard
var invisible: Boolean = false
Link copied to clipboard
var lastActive: Date? = null
Link copied to clipboard
var mutes: List<Mute>
Link copied to clipboard
var name: String
Link copied to clipboard
var online: Boolean = false
Link copied to clipboard
var role: String
Link copied to clipboard
val teams: List<String>
Link copied to clipboard
var totalUnreadCount: Int = 0
Link copied to clipboard
var unreadChannels: Int = 0
Link copied to clipboard
var updatedAt: Date? = null

Functions

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

Gets a comparable fields from a name.

Inherited functions

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

Extensions

Link copied to clipboard
val User.initials: String
Link copied to clipboard
fun User.mergePartially(that: User): User

Partially merges that user data into this user data.