aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-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 {