diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a90c602..89c2a6e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features * Optional Builtin ConverseJS +* Option for enabling live only on local videos ## v0.0.8 diff --git a/client/videowatch-client-plugin.js b/client/videowatch-client-plugin.js index 1dae9d80..d8d32fa1 100644 --- a/client/videowatch-client-plugin.js +++ b/client/videowatch-client-plugin.js @@ -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) { diff --git a/main.js b/main.js index fcbea58c..71b17391 100644 --- a/main.js +++ b/main.js @@ -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',