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/models/utils.ts | |
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/models/utils.ts')
-rw-r--r-- | server/models/utils.ts | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts index b2573cd35..88c9b4adb 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts | |||
@@ -136,10 +136,7 @@ function createSimilarityAttribute (col: string, value: string) { | |||
136 | ) | 136 | ) |
137 | } | 137 | } |
138 | 138 | ||
139 | function buildBlockedAccountSQL (serverAccountId: number, userAccountId?: number) { | 139 | function buildBlockedAccountSQL (blockerIds: number[]) { |
140 | const blockerIds = [ serverAccountId ] | ||
141 | if (userAccountId) blockerIds.push(userAccountId) | ||
142 | |||
143 | const blockerIdsString = blockerIds.join(', ') | 140 | const blockerIdsString = blockerIds.join(', ') |
144 | 141 | ||
145 | return 'SELECT "targetAccountId" AS "id" FROM "accountBlocklist" WHERE "accountId" IN (' + blockerIdsString + ')' + | 142 | return 'SELECT "targetAccountId" AS "id" FROM "accountBlocklist" WHERE "accountId" IN (' + blockerIdsString + ')' + |