diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-22 17:06:26 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-29 09:32:20 +0200 |
commit | 696d83fd1377486dd03cc1bd02a21d9b6ddd9fcd (patch) | |
tree | e1b88451c4357add80721f530993e2b48d197feb /server/controllers/api | |
parent | 72c33e716fecd1826dcf645957f8669821f91ff3 (diff) | |
download | PeerTube-696d83fd1377486dd03cc1bd02a21d9b6ddd9fcd.tar.gz PeerTube-696d83fd1377486dd03cc1bd02a21d9b6ddd9fcd.tar.zst PeerTube-696d83fd1377486dd03cc1bd02a21d9b6ddd9fcd.zip |
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)
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/videos/comment.ts | 2 |
1 files changed, 2 insertions, 0 deletions
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) { | |||
78 | if (video.commentsEnabled === true) { | 78 | if (video.commentsEnabled === true) { |
79 | const apiOptions = await Hooks.wrapObject({ | 79 | const apiOptions = await Hooks.wrapObject({ |
80 | videoId: video.id, | 80 | videoId: video.id, |
81 | isVideoOwned: video.isOwned(), | ||
81 | start: req.query.start, | 82 | start: req.query.start, |
82 | count: req.query.count, | 83 | count: req.query.count, |
83 | sort: req.query.sort, | 84 | sort: req.query.sort, |
@@ -108,6 +109,7 @@ async function listVideoThreadComments (req: express.Request, res: express.Respo | |||
108 | if (video.commentsEnabled === true) { | 109 | if (video.commentsEnabled === true) { |
109 | const apiOptions = await Hooks.wrapObject({ | 110 | const apiOptions = await Hooks.wrapObject({ |
110 | videoId: video.id, | 111 | videoId: video.id, |
112 | isVideoOwned: video.isOwned(), | ||
111 | threadId: res.locals.videoCommentThread.id, | 113 | threadId: res.locals.videoCommentThread.id, |
112 | user | 114 | user |
113 | }, 'filter:api.video-thread-comments.list.params') | 115 | }, 'filter:api.video-thread-comments.list.params') |