sanitizeAndCheckVideoTorrentUpdateActivity
} from './videos'
import { isViewActivityValid } from './view'
+import { exists } from '../misc'
function isRootActivityValid (activity: any) {
return Array.isArray(activity['@context']) && (
) ||
(
isActivityPubUrlValid(activity.id) &&
+ exists(activity.actor) &&
(isActivityPubUrlValid(activity.actor) || isActivityPubUrlValid(activity.actor.id))
)
)
if (activity.actor === objectUrl) {
let actor = await ActorModel.loadByUrl(activity.actor)
- if (!actor) return
+ if (!actor) return undefined
if (actor.type === 'Person') {
if (!actor.Account) throw new Error('Actor ' + actor.url + ' is a person but we cannot find it in database.')
}
}
- return
+ return undefined
}
// ---------------------------------------------------------------------------