From b3fa96eea0c6842459f978385a6b424a0beee4fa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 Jan 2021 11:06:11 +0100 Subject: Don't reject accounts with empty description --- server/helpers/custom-validators/activitypub/actor.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/helpers/custom-validators/activitypub/actor.ts b/server/helpers/custom-validators/activitypub/actor.ts index 2f44522a5..877345157 100644 --- a/server/helpers/custom-validators/activitypub/actor.ts +++ b/server/helpers/custom-validators/activitypub/actor.ts @@ -62,6 +62,7 @@ function isActorObjectValid (actor: any) { (!actor.followers || isActivityPubUrlValid(actor.followers)) && setValidAttributedTo(actor) && + setValidDescription(actor) && // If this is a group (a channel), it should be attributed to an account // In PeerTube we use this to attach a video channel to a specific account (actor.type !== 'Group' || actor.attributedTo.length !== 0) @@ -116,6 +117,12 @@ function areValidActorHandles (handles: string[]) { return isArray(handles) && handles.every(h => isValidActorHandle(h)) } +function setValidDescription (obj: any) { + if (!obj.summary) obj.summary = null + + return true +} + // --------------------------------------------------------------------------- export { -- cgit v1.2.3