library / io.getstream.chat.android.livedata.entity / ReactionEntity

ReactionEntity

data class ReactionEntity

The ReactionEntity

message id, user id and type are required created at and score are optional. score allows you to implement reactions where one user can like/clap something multiple times

You can convert a Reaction object from the low level client to a ReactionEntity like this: val reactionEntity = ReactionEntity(reaction) and back: reactionEntity.toUser()

Constructors

<init>

create a reactionEntity from a reaction object

ReactionEntity(r: Reaction)

The ReactionEntity

ReactionEntity(messageId: String, userId: String, type: String)

Properties

createdAt

when the reaction was created

var createdAt: Date?

deletedAt

when the reaction was deleted, this field is only stored in the local db

var deletedAt: Date?

extraData

all the custom data provided for this reaction

var extraData: MutableMap<String, Any>

messageId

var messageId: String

score

the score, used if you want to allow users to clap/like etc multiple times

var score: Int

syncStatus

if the reaction has been synced to the servers

var syncStatus: SyncStatus

type

var type: String

updatedAt

when the reaction was updated

var updatedAt: Date?

userId

var userId: String

Functions

toReaction

converts a reaction entity into a Reaction

fun toReaction(userMap: Map<String, User>): Reaction