ChatState
data class ChatState(val phase: ChatPhase = ChatPhase.IDLE, val connection: HatangConnectionState = HatangConnectionState.DISCONNECTED, val config: SiteConfig? = null, val visitor: VisitorDto? = null, val conversation: ConversationSummary? = null, val timeline: Timeline = Timeline.EMPTY, val pending: List<PendingMessage> = emptyList(), val typingAgent: String? = null, val availability: Availability = Availability.OFFLINE, val unread: Int = 0, val locale: HatangLocale = HatangLocale.VI, val needsEmail: Boolean = false, val skippedEmail: Boolean = false, val rated: Int? = null, val transientError: HatangException? = null, val outdatedReason: String? = null, val visitorEmail: String? = null, val visitorName: String? = null, val loadingEarlier: Boolean = false, val visible: Boolean = false, val foreground: Boolean = true, val draft: String? = null)
Immutable snapshot of everything the UI renders (ChatEngine.state).
Constructors
Link copied to clipboard
constructor(phase: ChatPhase = ChatPhase.IDLE, connection: HatangConnectionState = HatangConnectionState.DISCONNECTED, config: SiteConfig? = null, visitor: VisitorDto? = null, conversation: ConversationSummary? = null, timeline: Timeline = Timeline.EMPTY, pending: List<PendingMessage> = emptyList(), typingAgent: String? = null, availability: Availability = Availability.OFFLINE, unread: Int = 0, locale: HatangLocale = HatangLocale.VI, needsEmail: Boolean = false, skippedEmail: Boolean = false, rated: Int? = null, transientError: HatangException? = null, outdatedReason: String? = null, visitorEmail: String? = null, visitorName: String? = null, loadingEarlier: Boolean = false, visible: Boolean = false, foreground: Boolean = true, draft: String? = null)
Properties
Link copied to clipboard
Team availability.
Link copied to clipboard
Site settings (after bootstrap).
Link copied to clipboard
Socket state.
Link copied to clipboard
The active conversation.
Link copied to clipboard
The app is in the foreground.
Link copied to clipboard
An earlier page is loading.
Link copied to clipboard
Locale in use.
Link copied to clipboard
Show the pre-chat (offline) form before sending.
Link copied to clipboard
Why the gateway wants a newer SDK.
Link copied to clipboard
Outgoing messages without an ack.
Link copied to clipboard
Host-facing session view.
Link copied to clipboard
The visitor skipped the optional email form this session.
Link copied to clipboard
Last error worth a banner (cleared by the UI).
Link copied to clipboard
Name of the agent typing (empty string when unnamed); null when nobody is.
Link copied to clipboard
The visitor (after bootstrap).
Link copied to clipboard
Email known for the visitor (from bootstrap, identify or forms).
Link copied to clipboard
Name known for the visitor.