Chat federation: add metadata in ActivityPub. WIP

This commit is contained in:
John Livingston
2023-04-19 19:07:08 +02:00
parent bcafac5cce
commit 115fcd8484
7 changed files with 2675 additions and 4496 deletions

10
server/lib/uri/full.ts Normal file
View File

@ -0,0 +1,10 @@
import type { RegisterServerOptions } from '@peertube/peertube-types'
import * as url from 'url'
export function fullUri (options: RegisterServerOptions, path: string): string {
if (path.startsWith('https://') || path.startsWith('http://')) {
return path
}
const uri = new url.URL(path, options.peertubeHelpers.config.getWebserverUrl())
return uri.toString()
}

13
server/lib/uri/webchat.ts Normal file
View File

@ -0,0 +1,13 @@
import type { RegisterServerOptions } from '@peertube/peertube-types'
import { getBaseRouterRoute, getBaseWebSocketRoute } from '../helpers'
export function getBoshUri (options: RegisterServerOptions): string {
return getBaseRouterRoute(options) + 'http-bind'
}
export function getWSUri (options: RegisterServerOptions): string | undefined {
const base = getBaseWebSocketRoute(options) // can be undefined if Peertube is too old
if (base === undefined) { return undefined }
return base + 'xmpp-websocket'
}