From 17be75e0ee72b7e0df36c5867f1550066cf908cb Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 15 Aug 2023 19:28:36 -0400 Subject: [PATCH] lock conversation read-only commit --- .../README.md.txt | 17 ++++ .../index.html | 88 +++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 howtos/how-to-lock-a-conversation-to-read-only/README.md.txt create mode 100644 howtos/how-to-lock-a-conversation-to-read-only/index.html diff --git a/howtos/how-to-lock-a-conversation-to-read-only/README.md.txt b/howtos/how-to-lock-a-conversation-to-read-only/README.md.txt new file mode 100644 index 00000000..5de0eb97 --- /dev/null +++ b/howtos/how-to-lock-a-conversation-to-read-only/README.md.txt @@ -0,0 +1,17 @@ +This is an example project for TalkJS's tutorial on [How to lock a conversation to be read-only](https://talkjs.com/resources/how-to-lock-a-conversation-to-be-read-only/). + +The project uses TalkJS's [custom conversation actions](https://talkjs.com/docs/Features/Customizations/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](https://talkjs.com/docs/Reference/JavaScript_Chat_SDK/ConversationBuilder/#ConversationBuilder__setParticipant) method to set each participant's access level to read-only. + +## Prerequisites + +To run this tutorial, you will need: + +- A [TalkJS account](https://talkjs.com/dashboard/login) + +## How to run the tutorial + +1. Clone or download the project. +2. Go to the **Roles** tab of your TalkJS dashboard. Create a new role called "admin". +3. Click on the settings for the new admin role. In the **Custom conversation actions** section, add a new custom conversation action with a name of "setReadOnly" and a label of "Set Read-Only". +4. Replace `` in the `index.html` file with the value found in your [TalkJS dashboard](https://talkjs.com/dashboard/login). +5. Open index.html, or run debug the program in your IDE of choice. \ No newline at end of file diff --git a/howtos/how-to-lock-a-conversation-to-read-only/index.html b/howtos/how-to-lock-a-conversation-to-read-only/index.html new file mode 100644 index 00000000..d04d16a8 --- /dev/null +++ b/howtos/how-to-lock-a-conversation-to-read-only/index.html @@ -0,0 +1,88 @@ + + + + + + + + TalkJS tutorial + + + + + + + + + +
+ Loading chat... +
+ +