Option for enabling live only on local videos.

This commit is contained in:
John Livingston 2021-02-20 23:37:23 +01:00
parent 40d6ade8b6
commit a06961c5cc
3 changed files with 14 additions and 1 deletions

View File

@ -5,6 +5,7 @@
### Features
* Optional Builtin ConverseJS
* Option for enabling live only on local videos
## v0.0.8

View File

@ -185,7 +185,7 @@ function register ({ registerHook, peertubeHelpers }) {
const nonLiveOn = !!settings['chat-all-non-lives']
const uuids = parseUUIDs(settings['chat-videos-list'])
if (!uuids.length && !liveOn && !nonLiveOn) {
logger.log('not activated.')
logger.log('Feature not activated.')
return
}
@ -196,6 +196,11 @@ function register ({ registerHook, peertubeHelpers }) {
logger.error('Can\'t find the video ' + uuid + ' in the videoCache')
return
}
if (settings['chat-only-locals' && !video.isLocal]) {
logger.log('This video is not local, and we dont want chats on non local videos.')
return
}
if (uuids.indexOf(uuid) >= 0) {
logger.log('This video is in the list for chats.')
} else if (video.isLive && liveOn) {

View File

@ -19,6 +19,13 @@ async function register ({
default: false,
private: false
})
registerSetting({
name: 'chat-only-locals',
label: 'Chats are only available for local videos.',
type: 'input-checkbox',
default: true,
private: false
})
registerSetting({
name: 'chat-all-lives',
label: 'Activate chat for all lives',