Browse Source

Don't reject accounts with empty description

tags/v3.0.1
Chocobozzz 1 week ago
parent
commit
b3fa96eea0
No known key found for this signature in database GPG Key ID: 583A612D890159BE
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      server/helpers/custom-validators/activitypub/actor.ts

+ 7
- 0
server/helpers/custom-validators/activitypub/actor.ts View File

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


Loading…
Cancel
Save