FEP-1970: name attribute.

Related to #113.
This commit is contained in:
John Livingston
2023-07-05 12:10:27 +02:00
parent f7e7cddf72
commit 3627ef25f6
3 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,7 @@ import { getBoshUri, getWSUri, getWSS2SUri, getPublicChatUri } from '../uri/webc
import { canonicalizePluginUri } from '../uri/canonicalize'
import { getProsodyDomain } from '../prosody/config/domain'
import { fillVideoCustomFields } from '../custom-fields'
import { loc } from '../loc'
/**
* This function adds LiveChat information on video ActivityPub data if relevant.
@ -84,11 +85,13 @@ async function videoBuildJSONLD (
'chat-no-anonymous': settings['chat-no-anonymous']
})
const chatTitle = loc('chat_for_live_stream') + ' ' + video.name
// Adding attachments, as described in FEP-1970
const discussionLinks: LiveChatVideoObject['attachment'] = []
discussionLinks.push({
type: 'Link',
name: 'Chat', // TODO: getter naming, maybe use chat_for_live_stream loc string
name: chatTitle,
rel: 'discussion',
href: getPublicChatUri(options, videoJsonld)
})
@ -99,7 +102,7 @@ async function videoBuildJSONLD (
if (serverInfos.directs2s) {
discussionLinks.push({
type: 'Link',
name: 'Chat', // TODO: getter naming, maybe use chat_for_live_stream loc string
name: chatTitle,
rel: 'discussion',
href: 'xmpp://' + roomJID + '?join'
})