Don't reject accounts with empty description
This commit is contained in:
parent
078b4716cd
commit
b3fa96eea0
|
@ -62,6 +62,7 @@ function isActorObjectValid (actor: any) {
|
||||||
(!actor.followers || isActivityPubUrlValid(actor.followers)) &&
|
(!actor.followers || isActivityPubUrlValid(actor.followers)) &&
|
||||||
|
|
||||||
setValidAttributedTo(actor) &&
|
setValidAttributedTo(actor) &&
|
||||||
|
setValidDescription(actor) &&
|
||||||
// If this is a group (a channel), it should be attributed to an account
|
// 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
|
// In PeerTube we use this to attach a video channel to a specific account
|
||||||
(actor.type !== 'Group' || actor.attributedTo.length !== 0)
|
(actor.type !== 'Group' || actor.attributedTo.length !== 0)
|
||||||
|
@ -116,6 +117,12 @@ function areValidActorHandles (handles: string[]) {
|
||||||
return isArray(handles) && handles.every(h => isValidActorHandle(h))
|
return isArray(handles) && handles.every(h => isValidActorHandle(h))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setValidDescription (obj: any) {
|
||||||
|
if (!obj.summary) obj.summary = null
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
Loading…
Reference in New Issue