Using mod_muc_mam:

* Starting with Peertube 3.2.0, builtin prosody save room history on server. So when a user connects, he can get previously send messages.
* Fix: settings archive_expires_after was useless without mod_mam
This commit is contained in:
John Livingston
2021-05-11 16:10:57 +02:00
parent 094193a3b1
commit a602c7870a
3 changed files with 22 additions and 3 deletions

View File

@ -209,8 +209,19 @@ class ProsodyConfigContent {
this.muc.set('restrict_room_creation', false)
}
setArchive (duration: string): void {
this.global.set('archive_expires_after', duration)
/**
* Calling this method makes Prosody use mod_muc_mam to store rooms history.
* Should not be used when using a temporary dir.
* @param duration: how long the server must store messages. See https://prosody.im/doc/modules/mod_muc_mam
*/
useMam (duration: string): void {
this.muc.add('modules_enabled', 'muc_mam')
this.muc.set('muc_log_by_default', true)
this.muc.set('muc_log_presences', true)
this.muc.set('log_all_rooms', true)
this.muc.set('muc_log_expires_after', duration)
this.muc.set('muc_log_cleanup_interval', 4 * 60 * 60)
}
setLog (level: ProsodyLogLevel, syslog?: ProsodyLogLevel[]): void {