Presence

class Presence(key: String) : Attachable

Constructors

Link copied to clipboard
constructor(key: String)

Properties

Link copied to clipboard
val eventStream: SharedFlow<PresenceEvent>

Functions

Link copied to clipboard
open override fun applyStatus(status: ResourceStatus)

applyStatus applies the presence status into this presence counter.

Link copied to clipboard

getActorID returns the actor ID of this presence counter.

Link copied to clipboard
fun getCount(): Long

getCount returns the current count value.

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

getKey returns the key of this presence counter.

Link copied to clipboard

getPresenceID returns the presence ID from the server.

Link copied to clipboard
open override fun getStatus(): ResourceStatus

getStatus returns the status of this presence counter.

Link copied to clipboard
open override fun hasLocalChanges(): Boolean

hasLocalChanges returns whether this presence has local changes or not. Presence is server-managed, so it always returns false.

Link copied to clipboard

isAttached returns whether this presence counter is attached or not.

Link copied to clipboard
open override fun publish(event: ResourceEvent)

publish publishes an event to all registered handlers.

Link copied to clipboard
open override fun setActor(actorID: ActorID)

setActor sets the actor ID into this presence counter.

Link copied to clipboard
fun setPresenceId(presenceId: String)

setPresenceID sets the presence ID from the server.

Link copied to clipboard
fun updateCount(count: Long, seq: Long): Boolean

updateCount updates the count and sequence number if the sequence is newer. Returns true if the count was updated, false if the update was ignored.