diff --git a/support/documentation/content/en/documentation/user/streamers/terms.md b/support/documentation/content/en/documentation/user/streamers/terms.md index ba91a902..498ef731 100644 --- a/support/documentation/content/en/documentation/user/streamers/terms.md +++ b/support/documentation/content/en/documentation/user/streamers/terms.md @@ -40,3 +40,8 @@ You can change the terms content at any time, it will be instantly updated for a Users can hide the terms & conditions. When doing so, terms won't be shown again, unless you change the content. + +{{% notice info %}} +If your Peertube instance allows joining chat with [XMPP clients](https://livingston.frama.io/peertube-plugin-livechat/documentation/admin/advanced/xmpp_clients/), users using such clients will see the terms as chat messages, comming from a "Peertube" account. +When you update terms, they will receive a new message with the update terms content. +{{% /notice %}} diff --git a/support/documentation/content/en/technical/terms.md b/support/documentation/content/en/technical/terms.md new file mode 100644 index 00000000..eecd4365 --- /dev/null +++ b/support/documentation/content/en/technical/terms.md @@ -0,0 +1,70 @@ +--- +title: "Terms&Conditions" +description: "Terms&Conditions implementation" +weight: 65 +chapter: false +livechatnotranslation: true +--- + +You can set terms & conditions on the instance level (called "global terms"), or at the streamers' channels level (called "muc terms", as it is related to muc rooms). + +## Backend + +The `mod_muc_peertubelivechat_terms` prosody modules handles the terms configuration. + +It has a configuration option for the global terms. +It also adds muc terms in the room data. + +When a new occupant session is opened, this modules sends him messages containing the global and muc terms (if set). + +Here is an example of sent messages: + +```xml + + The global terms. + + + + + + + The muc terms. + + + + +``` + +Notice the `x-livechat-terms` tag. + +Standard XMPP clients will show these messages as standard message. + +Message are sent from a "service nickname": this occupant does not exist. +The service nickname is an option of the module (livechat use "Peertube", hard coded for now). +This nickname is reserved, no-one can spoof it (the module will bounce any request to use this nickname). +We must do so, because without nickname, some XMPP clients won't show the messages (tested with Gajim). + +We also add a `delay` tag, to trick the moderation bot (see comments in code). +This also ensure clients will not drop the message because there is no occupant with this name. + +When muc terms are updated, the new terms will be broadcasted. + +## Frontend + +For standard XMPP clients, terms will be shown as delayed messages. + +For the livechat frontend, there is a `livechat-converse-terms` Converse plugin that will intercept these messages, and prevent them to be shown in the chat history. + +It will also create infobox at the top of the chat to display the terms content. +If muc terms are updated, the new terms will be shown. + +Users can hide the terms. +To remember that a user has already hidden the terms, we store the content in localStorage. +We will only show terms again if the content in this localStorage changes. +We do so for both global terms and muc terms, in two separate localStorage keys. +The keys in localstorage does not depends on the room JID or the origin peertube instance. +This means that message will be shown again: + +* if terms are modified +* if the user switch to another channel +* if the user switch to a video from a different peertube instance