Chat federation: refactoring code + fix case when video has no chat
This commit is contained in:
21
server/lib/federation/incoming.ts
Normal file
21
server/lib/federation/incoming.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import type { RegisterServerOptions } from '@peertube/peertube-types'
|
||||
import type { RemoteVideoHandlerParams } from './types'
|
||||
|
||||
async function readIncomingAPVideo (
|
||||
options: RegisterServerOptions,
|
||||
{ video, videoAPObject }: RemoteVideoHandlerParams
|
||||
): Promise<void> {
|
||||
if (!('peertubeLiveChat' in videoAPObject)) {
|
||||
return
|
||||
}
|
||||
const logger = options.peertubeHelpers.logger
|
||||
// TODO: save the information.
|
||||
logger.debug(
|
||||
`Remote video uuid=${video.uuid} has a peertubeLiveChat attribute: ` +
|
||||
JSON.stringify(videoAPObject.peertubeLiveChat)
|
||||
)
|
||||
}
|
||||
|
||||
export {
|
||||
readIncomingAPVideo
|
||||
}
|
Reference in New Issue
Block a user