aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-11 11:06:11 +0100
committerChocobozzz <me@florianbigard.com>2021-01-11 11:06:11 +0100
commitb3fa96eea0c6842459f978385a6b424a0beee4fa (patch)
treed418a113f79d7bdba9c600a1733ffaa02428637c /server/helpers/custom-validators
parent078b4716cdd4dbf1b15c1a864ccab999ed3d0e8e (diff)
downloadPeerTube-b3fa96eea0c6842459f978385a6b424a0beee4fa.tar.gz
PeerTube-b3fa96eea0c6842459f978385a6b424a0beee4fa.tar.zst
PeerTube-b3fa96eea0c6842459f978385a6b424a0beee4fa.zip
Don't reject accounts with empty description
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/activitypub/actor.ts7
1 files changed, 7 insertions, 0 deletions
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) {
62 (!actor.followers || isActivityPubUrlValid(actor.followers)) && 62 (!actor.followers || isActivityPubUrlValid(actor.followers)) &&
63 63
64 setValidAttributedTo(actor) && 64 setValidAttributedTo(actor) &&
65 setValidDescription(actor) &&
65 // If this is a group (a channel), it should be attributed to an account 66 // If this is a group (a channel), it should be attributed to an account
66 // In PeerTube we use this to attach a video channel to a specific account 67 // In PeerTube we use this to attach a video channel to a specific account
67 (actor.type !== 'Group' || actor.attributedTo.length !== 0) 68 (actor.type !== 'Group' || actor.attributedTo.length !== 0)
@@ -116,6 +117,12 @@ function areValidActorHandles (handles: string[]) {
116 return isArray(handles) && handles.every(h => isValidActorHandle(h)) 117 return isArray(handles) && handles.every(h => isValidActorHandle(h))
117} 118}
118 119
120function setValidDescription (obj: any) {
121 if (!obj.summary) obj.summary = null
122
123 return true
124}
125
119// --------------------------------------------------------------------------- 126// ---------------------------------------------------------------------------
120 127
121export { 128export {