mirror of https://github.com/Chocobozzz/PeerTube
Fix lint
parent
90d4bb8125
commit
bcec136ee6
|
@ -16,6 +16,7 @@ import {
|
||||||
sanitizeAndCheckVideoTorrentUpdateActivity
|
sanitizeAndCheckVideoTorrentUpdateActivity
|
||||||
} from './videos'
|
} from './videos'
|
||||||
import { isViewActivityValid } from './view'
|
import { isViewActivityValid } from './view'
|
||||||
|
import { exists } from '../misc'
|
||||||
|
|
||||||
function isRootActivityValid (activity: any) {
|
function isRootActivityValid (activity: any) {
|
||||||
return Array.isArray(activity['@context']) && (
|
return Array.isArray(activity['@context']) && (
|
||||||
|
@ -26,6 +27,7 @@ function isRootActivityValid (activity: any) {
|
||||||
) ||
|
) ||
|
||||||
(
|
(
|
||||||
isActivityPubUrlValid(activity.id) &&
|
isActivityPubUrlValid(activity.id) &&
|
||||||
|
exists(activity.actor) &&
|
||||||
(isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id))
|
(isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,7 +15,7 @@ async function processDeleteActivity (activity: ActivityDelete) {
|
||||||
|
|
||||||
if (activity.actor === objectUrl) {
|
if (activity.actor === objectUrl) {
|
||||||
let actor = await ActorModel.loadByUrl(activity.actor)
|
let actor = await ActorModel.loadByUrl(activity.actor)
|
||||||
if (!actor) return
|
if (!actor) return undefined
|
||||||
|
|
||||||
if (actor.type === 'Person') {
|
if (actor.type === 'Person') {
|
||||||
if (!actor.Account) throw new Error('Actor ' + actor.url + ' is a person but we cannot find it in database.')
|
if (!actor.Account) throw new Error('Actor ' + actor.url + ' is a person but we cannot find it in database.')
|
||||||
|
@ -45,7 +45,7 @@ async function processDeleteActivity (activity: ActivityDelete) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue