Poll WIP (#231):

* various fix and improvements
This commit is contained in:
John Livingston
2024-07-04 14:04:33 +02:00
parent 1c6434630e
commit 4168b2ce41
6 changed files with 49 additions and 9 deletions

View File

@ -366,6 +366,8 @@ async function getProsodyConfig (options: RegisterServerOptionsV5): Promise<Pros
}
}
config.usePoll()
config.useTestModule(apikey, testApiUrl)
const debugMucAdminJids = debugMucAdmins(options)

View File

@ -248,8 +248,6 @@ class ProsodyConfigContent {
if (chatTerms) {
this.muc.set('muc_terms_global', new ConfigEntryValueMultiLineString(chatTerms))
}
this.muc.add('modules_enabled', 'muc_poll')
}
useAnonymous (autoBanIP: boolean): void {
@ -532,6 +530,14 @@ class ProsodyConfigContent {
}
}
/**
* Enable the poll feature.
*/
usePoll (): void {
this.muc.add('modules_enabled', 'muc_poll')
this.muc.set('poll_groupchat_votes_priority', 1000)
}
addMucAdmins (jids: string[]): void {
for (const jid of jids) {
this.muc.add('admins', jid)