This is an example project for TalkJS's tutorial on How to lock a conversation to be read-only.
The project uses TalkJS's custom conversation actions to add a new "Set read-only" option to the chat inbox UI. We add code to listen for this custom action and use the ConversationBuilder.setParticipant method to set each participant's access level to read-only.
To run this tutorial, you will need:
- Clone or download this project.
- At the top of the Chat UI page of your TalkJS dashboard, select Edit roles and create a new role called "admin".
- Again on the Chat UI page, select to edit the settings for the new admin role.
- Go to the Custom conversation actions section on the same page, and add a new custom conversation action with a name of "setReadOnly" and a label of "Set Read-Only".
- Replace
<APP_ID>
in theindex.html
file with the value found in your TalkJS dashboard. - Open
index.html
to view the chat.