Pin a message
The pinMessage
function exposed by the SDK allows you to pin at the top of a chat a message, specified by its messageId
.
If another message is already pinned, it is replaced.
Currently it is not possible to programmatically unpin a message.
The user needs to be owner of the room to be able to pin the message, otherwise an error will be returned.
Parameters
Parameter | Type | Description |
---|---|---|
messageId | string | Id of the message to be pinned. |
Returned promise
The Pin message function returns a JavaScript Promise that will resolve once the action has been completed. The promise has the following interface:
Success
- In case of success, the promise returns true
.
Error
- In case of error, the promise returns a SdkError
structure, with the following properties:
Parameter | Type | Description |
---|---|---|
type | string | Type of error:
|
message | string | Description of the error. |
data | Object | Additional data on the error, with the message Id that was specified for the pin method. |
Example
Last updated