Chat federation: add metadata in ActivityPub. WIP
This commit is contained in:
10
server/lib/uri/full.ts
Normal file
10
server/lib/uri/full.ts
Normal 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
13
server/lib/uri/webchat.ts
Normal 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'
|
||||
}
|
Reference in New Issue
Block a user