Drop deletes from actors that don't exist anymore #404
1 changed files with 9 additions and 2 deletions
|
@ -6,7 +6,7 @@ import { registerOrFetchInstanceDoc } from '@/services/register-or-fetch-instanc
|
|||
import { Instances } from '@/models/index.js';
|
||||
import { apRequestChart, federationChart, instanceChart } from '@/services/chart/index.js';
|
||||
import { extractPunyHost } from '@/misc/convert-host.js';
|
||||
import { getApId } from '@/remote/activitypub/type.js';
|
||||
import { getApId, isDelete } from '@/remote/activitypub/type.js';
|
||||
import { fetchInstanceMetadata } from '@/services/fetch-instance-metadata.js';
|
||||
import { Resolver } from '@/remote/activitypub/resolver.js';
|
||||
import { LdSignature } from '@/remote/activitypub/misc/ld-signature.js';
|
||||
|
@ -28,7 +28,14 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
|
|||
delete info['@context'];
|
||||
logger.debug(JSON.stringify(info, null, 2));
|
||||
//#endregion
|
||||
|
||||
if (isDelete(activity)) {
|
||||
try {
|
||||
await resolver.resolve(getApId(activity.actor))
|
||||
} catch (error) {
|
||||
logger.info("Dropped deletion request from actor that no longer exists")
|
||||
return 'ok';
|
||||
}
|
||||
}
|
||||
const validated = await verifyHttpSignature(signature, resolver, getApId(activity.actor));
|
||||
let authUser = validated.authUser;
|
||||
|
||||
|
|
Loading…
Reference in a new issue