This commit is contained in:
2024-12-03 17:03:42 -05:00
231 changed files with 18277 additions and 11174 deletions

View File

@ -3,3 +3,9 @@
// SPDX-License-Identifier: AGPL-3.0-only
export const channelTermsMaxLength = 400
export const forbidSpecialCharsDefaultTolerance = 0
export const forbidSpecialCharsMaxTolerance = 10
export const noDuplicateMaxDelay = 86400
export const noDuplicateDefaultDelay = 60

View File

@ -96,6 +96,8 @@ interface ChannelConfigurationOptions {
forbiddenWords: ChannelForbiddenWords[]
quotes: ChannelQuotes[]
commands: ChannelCommands[]
forbidSpecialChars: ChannelForbidSpecialChars
noDuplicate: ChannelNoDuplicate
// TODO: bannedJIDs: string[]
}
slowMode: {
@ -132,6 +134,20 @@ interface ChannelCommands {
message: string
}
interface ChannelForbidSpecialChars {
enabled: boolean
tolerance: number
reason: string
applyToModerators: boolean
}
interface ChannelNoDuplicate {
enabled: boolean
reason: string
delay: number
applyToModerators: boolean
}
interface ChannelConfiguration {
channel: ChannelInfos
configuration: ChannelConfigurationOptions

View File

@ -44,7 +44,7 @@ function videoHasWebchat (settings: VideoHasWebchatSettings, video: SharedVideo)
if (video.remote) return false
}
if (settings['chat-per-live-video'] && video.isLive && video.pluginData && video.pluginData['livechat-active']) {
if (settings['chat-per-live-video'] && video.isLive && video.pluginData?.['livechat-active']) {
return true
}