Option for enabling live only on local videos.
This commit is contained in:
parent
40d6ade8b6
commit
a06961c5cc
@ -5,6 +5,7 @@
|
||||
### Features
|
||||
|
||||
* Optional Builtin ConverseJS
|
||||
* Option for enabling live only on local videos
|
||||
|
||||
## v0.0.8
|
||||
|
||||
|
@ -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) {
|
||||
|
7
main.js
7
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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user