Builtin Prosody: new settings to choose how long the room's content is archived, and if it should be archived by default.

This commit is contained in:
John Livingston
2021-12-01 12:57:15 +01:00
parent e260f84584
commit 5e988605ce
6 changed files with 147 additions and 11 deletions

View File

@ -36,6 +36,20 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
result.messages.push(`Prosody rooms will be grouped by '${wantedConfig.roomType}'.`)
if (wantedConfig.logByDefault) {
result.messages.push('By default, room content will be archived.')
} else {
result.messages.push('By default, room content will not be archived.')
}
if ('error' in wantedConfig.logExpiration) {
result.messages.push({
level: 'error',
message: 'Errors: Room logs expiration value is not valid. Using the default value.'
})
}
result.messages.push(`Room content will be saved for '${wantedConfig.logExpiration.value}'`)
await fs.promises.access(filePath, fs.constants.R_OK) // throw an error if file does not exist.
result.messages.push(`The prosody configuration file (${filePath}) exists`)
const actualContent = await fs.promises.readFile(filePath, {