Message

@Immutable
data class Message(val id: String = "", val cid: String = "", val text: String = "", val html: String = "", val parentId: String? = null, val command: String? = null, val attachments: List<Attachment> = listOf(), val mentionedUsersIds: List<String> = listOf(), val mentionedUsers: List<User> = listOf(), val replyCount: Int = 0, val deletedReplyCount: Int = 0, val reactionCounts: Map<String, Int> = mapOf(), val reactionScores: Map<String, Int> = mapOf(), val reactionGroups: Map<String, ReactionGroup> = mapOf(), val syncStatus: SyncStatus = SyncStatus.COMPLETED, val type: String = "", val latestReactions: List<Reaction> = listOf(), val ownReactions: List<Reaction> = listOf(), val createdAt: Date? = null, val updatedAt: Date? = null, val deletedAt: Date? = null, val updatedLocallyAt: Date? = null, var createdLocallyAt: Date? = null, val user: User = User(), val extraData: Map<String, Any> = mapOf(), val silent: Boolean = false, val shadowed: Boolean = false, val i18n: Map<String, String> = mapOf(), val showInChannel: Boolean = false, val channelInfo: ChannelInfo? = null, val replyTo: Message? = null, val replyMessageId: String? = null, val pinned: Boolean = false, val pinnedAt: Date? = null, val pinExpires: Date? = null, val pinnedBy: User? = null, val threadParticipants: List<User> = emptyList(), val skipPushNotification: Boolean = false, val skipEnrichUrl: Boolean = false, val moderationDetails: MessageModerationDetails? = null, val messageTextUpdatedAt: Date? = null, val poll: Poll? = null) : CustomObject, ComparableFieldProvider

Constructors

Link copied to clipboard
constructor(id: String = "", cid: String = "", text: String = "", html: String = "", parentId: String? = null, command: String? = null, attachments: List<Attachment> = listOf(), mentionedUsersIds: List<String> = listOf(), mentionedUsers: List<User> = listOf(), replyCount: Int = 0, deletedReplyCount: Int = 0, reactionCounts: Map<String, Int> = mapOf(), reactionScores: Map<String, Int> = mapOf(), reactionGroups: Map<String, ReactionGroup> = mapOf(), syncStatus: SyncStatus = SyncStatus.COMPLETED, type: String = "", latestReactions: List<Reaction> = listOf(), ownReactions: List<Reaction> = listOf(), createdAt: Date? = null, updatedAt: Date? = null, deletedAt: Date? = null, updatedLocallyAt: Date? = null, createdLocallyAt: Date? = null, user: User = User(), extraData: Map<String, Any> = mapOf(), silent: Boolean = false, shadowed: Boolean = false, i18n: Map<String, String> = mapOf(), showInChannel: Boolean = false, channelInfo: ChannelInfo? = null, replyTo: Message? = null, replyMessageId: String? = null, pinned: Boolean = false, pinnedAt: Date? = null, pinExpires: Date? = null, pinnedBy: User? = null, threadParticipants: List<User> = emptyList(), skipPushNotification: Boolean = false, skipEnrichUrl: Boolean = false, moderationDetails: MessageModerationDetails? = null, messageTextUpdatedAt: Date? = null, poll: Poll? = null)

Types

Link copied to clipboard
class Builder
Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The list of message attachments

Link copied to clipboard
Link copied to clipboard
val cid: String

Channel unique identifier in : format

Link copied to clipboard
val command: String? = null

Contains provided slash command

Link copied to clipboard
val createdAt: Date? = null

When the message was created

Link copied to clipboard

When the message was created locally

Link copied to clipboard
val deletedAt: Date? = null

When the message was deleted

Link copied to clipboard

The number of deleted replies to this message

Link copied to clipboard
open override val extraData: Map<String, Any>

All the custom data provided for this message

Link copied to clipboard

The message text formatted as HTML

Link copied to clipboard

Mapping with translations. Key language contains the original language key. Other keys contain translations.

Link copied to clipboard
val id: String

The unique string identifier of the message. This is either created by Stream or set on the client side when the message is added.

Link copied to clipboard

List of the latest reactions to this message

Link copied to clipboard

The list of user mentioned in the message

Link copied to clipboard

The list of user mentioned in the message

Link copied to clipboard

Date when the message text was updated

Link copied to clipboard

Contains moderation details of the message.

Link copied to clipboard
Link copied to clipboard

List of reactions of authenticated user to this message

Link copied to clipboard
val parentId: String? = null

The ID of the parent message, if the message is a thread reply

Link copied to clipboard
val pinExpires: Date? = null

Date when pinned message expires

Link copied to clipboard
val pinned: Boolean = false

Whether message is pinned or not

Link copied to clipboard
val pinnedAt: Date? = null

Date when the message got pinned

Link copied to clipboard
val pinnedBy: User? = null

Contains user who pinned the message

Link copied to clipboard
val poll: Poll? = null

Contains poll configuration

Link copied to clipboard

A mapping between reaction type and the count, ie like:10, heart:4

Link copied to clipboard

A mapping between reaction type and the ReactionGroup.

Link copied to clipboard

A mapping between reaction type and the reaction score, ie like:10, heart:4

Link copied to clipboard
val replyCount: Int = 0

The number of replies to this message

Link copied to clipboard
val replyMessageId: String? = null

The ID of the quoted message, if the message is a quoted reply.

Link copied to clipboard
val replyTo: Message? = null

Contains quoted message

Link copied to clipboard
val shadowed: Boolean = false

If the message was sent by shadow banned user

Link copied to clipboard
val showInChannel: Boolean = false

Whether thread reply should be shown in the channel as well

Link copied to clipboard
val silent: Boolean = false

Whether message is silent or not

Link copied to clipboard
val skipEnrichUrl: Boolean = false

If the message should skip enriching the URL. If URl is not enriched, it will not be displayed as a link attachment. Used when sending or updating a message. False by default.

Link copied to clipboard

If the message should skip triggering a push notification when sent. Used when sending a new message. False by default.

Link copied to clipboard

If the message has been synced to the servers, default is synced

Link copied to clipboard

The text of this message

Link copied to clipboard

The list of users who participate in thread

Link copied to clipboard

Contains type of the message. Can be one of the following: regular, ephemeral, error, reply, system, deleted.

Link copied to clipboard
val updatedAt: Date? = null

When the message was updated

Link copied to clipboard
val updatedLocallyAt: Date? = null

When the message was updated locally

Link copied to clipboard
val user: User

The user who sent the message

Functions

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

Gets a comparable fields from a name.

Link copied to clipboard
fun getTranslation(language: String): String
Link copied to clipboard

Identifier of message. The message can't be considered the same if the id of the message AND the id of a quoted message are not the same.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String

Inherited functions

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