mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00

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
16 lines
501 B
TypeScript
16 lines
501 B
TypeScript
import { isActivityPubUrlValid } from './misc'
|
|
import { isRemoteVideoUrlValid } from './videos'
|
|
import { exists, isDateValid } from '../misc'
|
|
import { CacheFileObject } from '../../../../shared/models/activitypub/objects'
|
|
|
|
function isCacheFileObjectValid (object: CacheFileObject) {
|
|
return exists(object) &&
|
|
object.type === 'CacheFile' &&
|
|
isDateValid(object.expires) &&
|
|
isActivityPubUrlValid(object.object) &&
|
|
isRemoteVideoUrlValid(object.url)
|
|
}
|
|
|
|
export {
|
|
isCacheFileObjectValid
|
|
}
|