From 696d83fd1377486dd03cc1bd02a21d9b6ddd9fcd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 22 May 2020 17:06:26 +0200 Subject: Block comments from muted accounts/servers Add better control for users of comments displayed on their videos: * Do not forward comments from muted remote accounts/servers (muted by the current server or by the video owner) * Do not list threads and hide replies (with their children) of accounts/servers muted by the video owner * Hide from RSS comments of muted accounts/servers by video owners Use case: * Try to limit spam propagation in the federation * Add ability for users to automatically hide comments on their videos from undesirable accounts/servers (the comment section belongs to videomakers, so they choose what's posted there) --- server/controllers/api/videos/comment.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server/controllers/api/videos') diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts index 2dcb85ecf..45ff969d9 100644 --- a/server/controllers/api/videos/comment.ts +++ b/server/controllers/api/videos/comment.ts @@ -78,6 +78,7 @@ async function listVideoThreads (req: express.Request, res: express.Response) { if (video.commentsEnabled === true) { const apiOptions = await Hooks.wrapObject({ videoId: video.id, + isVideoOwned: video.isOwned(), start: req.query.start, count: req.query.count, sort: req.query.sort, @@ -108,6 +109,7 @@ async function listVideoThreadComments (req: express.Request, res: express.Respo if (video.commentsEnabled === true) { const apiOptions = await Hooks.wrapObject({ videoId: video.id, + isVideoOwned: video.isOwned(), threadId: res.locals.videoCommentThread.id, user }, 'filter:api.video-thread-comments.list.params') -- cgit v1.2.3