Chat can be enabled in video properties.

This commit is contained in:
John Livingston
2021-06-08 18:08:58 +02:00
parent 07b7f4d732
commit 385a0074c1
11 changed files with 154 additions and 16 deletions

View File

@ -2,6 +2,7 @@ import { parseConfigUUIDs } from './config'
interface SharedSettings {
'chat-only-locals': boolean
'chat-per-live-video': boolean
'chat-all-lives': boolean
'chat-all-non-lives': boolean
'chat-videos-list': string
@ -10,6 +11,9 @@ interface SharedSettings {
interface SharedVideoBase {
uuid: string
isLive: boolean
pluginData?: {
'livechat-active'?: boolean
}
}
interface SharedVideoFrontend extends SharedVideoBase {
@ -31,6 +35,10 @@ function videoHasWebchat (settings: SharedSettings, video: SharedVideo): boolean
}
}
if (settings['chat-per-live-video'] && video.isLive && video.pluginData && video.pluginData['livechat-active']) {
return true
}
if (settings['chat-all-lives']) {
if (video.isLive) return true
}