Accept unlisted comments too
authorChocobozzz <me@florianbigard.com>
Wed, 4 Apr 2018 07:52:45 +0000 (09:52 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 4 Apr 2018 07:59:31 +0000 (09:59 +0200)
server/helpers/custom-validators/activitypub/video-comments.ts

index 079fee43448cf48e3bbc037e318c3797d22a6dfd..7e8cfece27776bc45efd82dbd310786e138bd8b8 100644 (file)
@@ -16,7 +16,10 @@ function isVideoCommentObjectValid (comment: any) {
     isDateValid(comment.published) &&
     isActivityPubUrlValid(comment.url) &&
     isArray(comment.to) &&
-    comment.to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 // Only accept public comments
+    (
+      comment.to.indexOf(ACTIVITY_PUB.PUBLIC) !== -1 ||
+      comment.cc.indexOf(ACTIVITY_PUB.PUBLIC) !== -1
+    ) // Only accept public comments
 }
 
 function isVideoCommentDeleteActivityValid (activity: any) {