Builtin Prosody: display random avatars for anonymous users.

This commit is contained in:
John Livingston
2022-01-06 05:30:55 +01:00
parent cb60a7799d
commit bf35172856
17 changed files with 3174 additions and 2 deletions

View File

@ -60,7 +60,8 @@ async function getProsodyFilePaths (options: RegisterServerOptions): Promise<Pro
log: path.resolve(dir, 'prosody.log'),
config: path.resolve(dir, 'prosody.cfg.lua'),
data: path.resolve(dir, 'data'),
modules: path.resolve(__dirname, '../../prosody-modules')
modules: path.resolve(__dirname, '../../prosody-modules'),
avatars: path.resolve(__dirname, '../../avatars')
}
}
@ -153,6 +154,7 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
config.useListRoomsApi(apikey)
config.usePeertubeVCards(basePeertubeUrl)
config.useAnonymousRandomVCards(paths.avatars)
config.useTestModule(apikey, testApiUrl)

View File

@ -308,6 +308,13 @@ class ProsodyConfigContent {
}
}
useAnonymousRandomVCards (avatarPath: string): void {
if (this.anon) {
this.anon.add('modules_enabled', 'random_vcard_peertubelivechat')
this.anon.set('peertubelivechat_random_vcard_avatars_path', avatarPath)
}
}
setLog (level: ProsodyLogLevel, syslog?: ProsodyLogLevel[]): void {
let log = ''
log += 'log = {\n'

View File

@ -6,6 +6,7 @@ interface ProsodyFilePaths {
config: string
data: string
modules: string
avatars: string
}
export {