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:
John Livingston
2024-06-20 16:46:14 +02:00
parent 1f1543bc97
commit 5a455fff93
57 changed files with 2959 additions and 944 deletions

View File

@ -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')
}
}

View File

@ -49,6 +49,9 @@ function getDefaultChannelConfigurationOptions (_options: RegisterServerOptions)
},
slowMode: {
duration: 0
},
mute: {
anonymous: false
}
}
}