Skip to content

Commit

Permalink
Don't accept activities from actors less than 1 day old
Browse files Browse the repository at this point in the history
  • Loading branch information
hutchisr committed Oct 9, 2024
1 parent 8b260d6 commit 111049a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/backend/src/core/activitypub/ApInboxService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ export class ApInboxService {
public async performOneActivity(actor: MiRemoteUser, activity: IObject): Promise<string | void> {
if (actor.isSuspended) return;

if ((new Date()).getTime() - this.idService.parse(actor.id).date.getTime() < 86_400_000 ) {
return 'skip: actor must be older than 1 day';
}

if (isCreate(activity)) {
return await this.create(actor, activity);
} else if (isDelete(activity)) {
Expand Down

0 comments on commit 111049a

Please sign in to comment.