New option to only allow registered users to speak WIP (#233):
* Prosody mod_muc_peertubelivechat_roles module * Fix ConverseJS to disable the message field when room is unmoderated and user is visitor * Mute/voice anonymous users when changing room configuration. * Display a specific message to muted anonymous users. * Default value for mute_anonymous in channel options. * Feature documentation
This commit is contained in:
@ -35,6 +35,14 @@ async function sanitizeChannelConfigurationOptions (
|
||||
throw new Error('Invalid data.slowMode data type')
|
||||
}
|
||||
|
||||
// mute not present in livechat <= 10.2.0
|
||||
const mute = data.mute ?? {}
|
||||
mute.anonymous ??= false
|
||||
|
||||
if (typeof mute !== 'object') {
|
||||
throw new Error('Invalid data.mute data type')
|
||||
}
|
||||
|
||||
const result: ChannelConfigurationOptions = {
|
||||
bot: {
|
||||
enabled: _readBoolean(botData, 'enabled'),
|
||||
@ -46,6 +54,9 @@ async function sanitizeChannelConfigurationOptions (
|
||||
},
|
||||
slowMode: {
|
||||
duration: _readInteger(slowModeData, 'duration', 0, 1000)
|
||||
},
|
||||
mute: {
|
||||
anonymous: _readBoolean(mute, 'anonymous')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,9 @@ function getDefaultChannelConfigurationOptions (_options: RegisterServerOptions)
|
||||
},
|
||||
slowMode: {
|
||||
duration: 0
|
||||
},
|
||||
mute: {
|
||||
anonymous: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user