Add video abuse to activity pub

This commit is contained in:
Chocobozzz 2017-11-15 15:12:23 +01:00
parent 59c857da59
commit 8e13fa7d09
No known key found for this signature in database
GPG key ID: 583A612D890159BE
13 changed files with 114 additions and 68 deletions

View file

@ -22,10 +22,11 @@ function generateThumbnailFromUrl (video: VideoInstance, icon: ActivityIconObjec
return doRequestAndSaveToFile(options, thumbnailPath)
}
function getActivityPubUrl (type: 'video' | 'videoChannel' | 'account', id: string) {
function getActivityPubUrl (type: 'video' | 'videoChannel' | 'account' | 'videoAbuse', id: string) {
if (type === 'video') return CONFIG.WEBSERVER.URL + '/videos/watch/' + id
else if (type === 'videoChannel') return CONFIG.WEBSERVER.URL + '/video-channels/' + id
else if (type === 'account') return CONFIG.WEBSERVER.URL + '/account/' + id
else if (type === 'videoAbuse') return CONFIG.WEBSERVER.URL + '/admin/video-abuses/' + id
return ''
}
@ -134,7 +135,8 @@ function activityPubContextify <T> (data: T) {
'nsfw': 'as:sensitive',
'language': 'http://schema.org/inLanguage',
'views': 'http://schema.org/Number',
'size': 'http://schema.org/Number'
'size': 'http://schema.org/Number',
'VideoChannel': 'https://peertu.be/ns/VideoChannel'
}
]
})