peertube-plugin-livechat/server/lib/diagnostic/index.ts
John Livingston 7906ddf625
Prosody mode only:
Removing old modes (ConverseJS and External URI).
Work in progress.
2022-10-10 18:08:20 +02:00

23 lines
702 B
TypeScript

import type { RegisterServerOptions } from '@peertube/peertube-types'
import { diagBackend } from './backend'
import { TestResult, newResult } from './utils'
import { diagProsody } from './prosody'
import { diagVideo } from './video'
export async function diag (test: string, options: RegisterServerOptions): Promise<TestResult> {
let result: TestResult
if (test === 'backend') {
result = await diagBackend(test, options)
} else if (test === 'webchat-video') {
result = await diagVideo(test, options)
} else if (test === 'prosody') {
result = await diagProsody(test, options)
} else {
result = newResult(test)
result.messages.push('Unknown test')
}
return result
}