ChatThreadsHandler

Instance that allows modification, manipulation and observing of threads.

Some methods of this class depend on configuration sent from the server. If the configuration changes remotely, you need to call ChatBuilder.build again and use the newly created instance. The saved configuration will never change at run-time.

There are no effects attached to initialization of this class.

Types

Link copied to clipboard

Listener which allows the user to subscribe to thread list changes.

Properties

Link copied to clipboard

A pre-chat form which should be answered by the user before create is called. Answers have to be supplied as custom fields in the create call.

Functions

Link copied to clipboard

Creates a new thread -if permitted by the configuration- and returns a handler for it. threads should return this new instance even if it's not created on the server yet.

open fun create(customFields: Map<String, String>): ChatThreadHandler
open fun create(preChatSurveyResponse: Sequence<PreChatSurveyResponse<out FieldDefinition, out Any>>): ChatThreadHandler
abstract fun create(customFields: Map<String, String>, preChatSurveyResponse: Sequence<PreChatSurveyResponse<out FieldDefinition, out Any>>): ChatThreadHandler

Creates a new thread -if permitted by configuration- and returns a handler for it. threads should return this new instance even if it's not created on the server yet.

Link copied to clipboard
abstract fun refresh()

Sends a request to refresh the thread-list.

Link copied to clipboard
abstract fun thread(thread: ChatThread): ChatThreadHandler

Creates a new thread handler with given thread. thread is used as a template and this particular instance will not be updated in response to changes in the handler.

Link copied to clipboard

Registers a listeners on this instance that returns new value every time client calls refresh or server imperatively forces a refresh remotely.