Share via


ChatAdapterThreadManagement interface

Functionality for managing the current chat thread.

Methods

deleteMessage(string)

Delete a message in the thread.

downloadResourceToCache(ResourceDetails)

Downloads a resource into the cache for the given message.

fetchInitialData()

Fetch initial state for the Chat adapter.

Performs the minimal fetch necessary for ChatComposite and API methods.

loadPreviousChatMessages(number)

Load more previous messages in the chat thread history.

removeParticipant(string)

Remove a participant in the thread.

removeResourceFromCache(ResourceDetails)

Removes a resource from the cache for the given message.

sendMessage(string, SendMessageOptions)

Send a message in the thread. Please note that SendMessageOptions is being deprecated, please use MessageOptions instead.

sendReadReceipt(string)

Send a read receipt for a message.

sendTypingIndicator()

Send typing indicator in the thread.

setTopic(string)

Set the topic for the thread.

updateMessage(string, string, Record<string, string>)

Update a message content. Please note that metadata is being deprecated, please use MessageOptions.metadata instead.

Method Details

deleteMessage(string)

Delete a message in the thread.

function deleteMessage(messageId: string): Promise<void>

Parameters

messageId

string

Returns

Promise<void>

downloadResourceToCache(ResourceDetails)

Downloads a resource into the cache for the given message.

function downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>

Parameters

resourceDetails
ResourceDetails

Returns

Promise<void>

fetchInitialData()

Fetch initial state for the Chat adapter.

Performs the minimal fetch necessary for ChatComposite and API methods.

function fetchInitialData(): Promise<void>

Returns

Promise<void>

loadPreviousChatMessages(number)

Load more previous messages in the chat thread history.

function loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>

Parameters

messagesToLoad

number

Returns

Promise<boolean>

Remarks

This method is usually used to control incremental fetch/infinite scroll

removeParticipant(string)

Remove a participant in the thread.

function removeParticipant(userId: string): Promise<void>

Parameters

userId

string

Returns

Promise<void>

removeResourceFromCache(ResourceDetails)

Removes a resource from the cache for the given message.

function removeResourceFromCache(resourceDetails: ResourceDetails)

Parameters

resourceDetails
ResourceDetails

sendMessage(string, SendMessageOptions)

Send a message in the thread. Please note that SendMessageOptions is being deprecated, please use MessageOptions instead.

function sendMessage(content: string, options?: SendMessageOptions): Promise<void>

Parameters

content

string

Returns

Promise<void>

sendReadReceipt(string)

Send a read receipt for a message.

function sendReadReceipt(chatMessageId: string): Promise<void>

Parameters

chatMessageId

string

Returns

Promise<void>

sendTypingIndicator()

Send typing indicator in the thread.

function sendTypingIndicator(): Promise<void>

Returns

Promise<void>

setTopic(string)

Set the topic for the thread.

function setTopic(topicName: string): Promise<void>

Parameters

topicName

string

Returns

Promise<void>

updateMessage(string, string, Record<string, string>)

Update a message content. Please note that metadata is being deprecated, please use MessageOptions.metadata instead.

function updateMessage(messageId: string, content: string, options?: Record<string, string>): Promise<void>

Parameters

messageId

string

content

string

options

Record<string, string>

Returns

Promise<void>