Add support for disabling chat. Closes #472 (#799)

This commit is contained in:
Gabe Kangas
2021-03-14 11:46:27 -07:00
committed by GitHub
parent 40264bec8c
commit bf33d08384
8 changed files with 183 additions and 97 deletions

View File

@@ -33,6 +33,7 @@ const s3StorageEnabledKey = "s3_storage_enabled"
const s3StorageConfigKey = "s3_storage_config"
const videoLatencyLevel = "video_latency_level"
const videoStreamOutputVariantsKey = "video_stream_output_variants"
const chatDisabledKey = "chat_disabled"
// GetExtraPageBodyContent will return the user-supplied body content.
func GetExtraPageBodyContent() string {
@@ -408,6 +409,21 @@ func SetStreamOutputVariants(variants []models.StreamOutputVariant) error {
return _datastore.Save(configEntry)
}
// SetChatDisabled will disable chat if set to true.
func SetChatDisabled(disabled bool) error {
return _datastore.SetBool(chatDisabledKey, disabled)
}
// GetChatDisabled will return if chat is disabled.
func GetChatDisabled() bool {
disabled, err := _datastore.GetBool(chatDisabledKey)
if err == nil {
return disabled
}
return false
}
// VerifySettings will perform a sanity check for specific settings values.
func VerifySettings() error {
if GetStreamKey() == "" {