pull/632/merge
Chocobozzz 2018-06-13 14:55:18 +02:00
parent 90d4bb8125
commit bcec136ee6
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 4 additions and 2 deletions

View File

@ -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))
) )
) )

View File

@ -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
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------