Emoji only mode WIP:

* refactoring + optimization
* migration
This commit is contained in:
John Livingston
2024-09-06 11:01:48 +02:00
parent b115c28ee7
commit 08017ac2bb
12 changed files with 172 additions and 50 deletions

View File

@ -260,8 +260,6 @@ class ProsodyConfigContent {
this.muc.set('anonymize_moderation_actions_form_position', 117)
this.muc.add('modules_enabled', 'muc_mam_search')
this.muc.add('modules_enabled', 'muc_peertubelivechat_restrict_message')
}
useAnonymous (autoBanIP: boolean): void {
@ -564,6 +562,18 @@ class ProsodyConfigContent {
this.global.set('firewall_scripts', files)
}
/**
* Enable and configure the restrict message module.
* @param commonEmojiRegexp A regexp to match common emojis.
*/
useRestrictMessage (commonEmojiRegexp: string): void {
this.muc.add('modules_enabled', 'muc_peertubelivechat_restrict_message')
this.muc.set(
'peertubelivechat_restrict_message_common_emoji_regexp',
new ConfigEntryValueMultiLineString(commonEmojiRegexp)
)
}
addMucAdmins (jids: string[]): void {
for (const jid of jids) {
this.muc.add('admins', jid)