1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Prepare Dislike/Flag/View fixes

For now we Create these activities, but we should just send them
directly.

This fix handles correctly direct Dislikes/Flags/Views, we'll implement
the sending correctly these activities in the next peertube version
This commit is contained in:
Chocobozzz 2019-01-15 11:14:12 +01:00
parent 44b9c0ba31
commit 848f499def
No known key found for this signature in database
GPG key ID: 583A612D890159BE
30 changed files with 330 additions and 755 deletions

View file

@ -3,11 +3,6 @@ import { ACTIVITY_PUB, CONSTRAINTS_FIELDS } from '../../../initializers'
import { exists, isArray, isDateValid } from '../misc'
import { isActivityPubUrlValid, isBaseActivityValid } from './misc'
function isVideoCommentCreateActivityValid (activity: any) {
return isBaseActivityValid(activity, 'Create') &&
sanitizeAndCheckVideoCommentObject(activity.object)
}
function sanitizeAndCheckVideoCommentObject (comment: any) {
if (!comment || comment.type !== 'Note') return false
@ -25,15 +20,9 @@ function sanitizeAndCheckVideoCommentObject (comment: any) {
) // Only accept public comments
}
function isVideoCommentDeleteActivityValid (activity: any) {
return isBaseActivityValid(activity, 'Delete')
}
// ---------------------------------------------------------------------------
export {
isVideoCommentCreateActivityValid,
isVideoCommentDeleteActivityValid,
sanitizeAndCheckVideoCommentObject
}