ChatThreadMessageHandler

Manages all the necessary procedures required for service messages. This newly created object influences changes in parent ChatThreadHandler in number of ways. Though it does not modify the parent directly, it can force some events to happen which in-turn update the data.

It has no side effects attached to it.

Types

Link copied to clipboard

Listener allows receiving of transfer notifications.

Link copied to clipboard
fun interface OnUUIDListener

Listener for simple inline id notifications.

Functions

Link copied to clipboard
abstract fun loadMore()

Notifies server that we need to load more messages. This expects that the instance provided by parent ChatThreadHandler has the most up-to-date data. Be warned that calling this method on a thread that has not been updated has undefined consequences. It can result, for example, in message duplication.

Link copied to clipboard

Sends a message and optionally notifies the client about the message being processed or sent.

open fun send(message: String, postback: String? = null, listener: ChatThreadMessageHandler.OnMessageTransferListener? = null)

Simplified method to send a simple user message to the agent.

open fun send(attachments: Iterable<ContentDescriptor>, message: String = "", postback: String? = null, listener: ChatThreadMessageHandler.OnMessageTransferListener? = null)

Simplified method to send an attachment to the agent.