diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-29 14:31:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-29 14:31:04 +0200 |
commit | f0a47bc92aa20b91b46197a4d3fc430aea962848 (patch) | |
tree | 104bb5dd7facc0d4db09c7deeea9e189f930e72e /server/controllers/api/videos/abuse.ts | |
parent | 3155c8606cff211f495bf71c75c56cae85a5430f (diff) | |
download | PeerTube-f0a47bc92aa20b91b46197a4d3fc430aea962848.tar.gz PeerTube-f0a47bc92aa20b91b46197a4d3fc430aea962848.tar.zst PeerTube-f0a47bc92aa20b91b46197a4d3fc430aea962848.zip |
Hide video abuses from muted accounts
Diffstat (limited to 'server/controllers/api/videos/abuse.ts')
-rw-r--r-- | server/controllers/api/videos/abuse.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts index 39c841ffe..4ae899b7e 100644 --- a/server/controllers/api/videos/abuse.ts +++ b/server/controllers/api/videos/abuse.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared' | 2 | import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared' |
3 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
4 | import { getFormattedObjects } from '../../../helpers/utils' | 4 | import { getFormattedObjects, getServerActor } from '../../../helpers/utils' |
5 | import { sequelizeTypescript } from '../../../initializers' | 5 | import { sequelizeTypescript } from '../../../initializers' |
6 | import { | 6 | import { |
7 | asyncMiddleware, | 7 | asyncMiddleware, |
@@ -62,7 +62,16 @@ export { | |||
62 | // --------------------------------------------------------------------------- | 62 | // --------------------------------------------------------------------------- |
63 | 63 | ||
64 | async function listVideoAbuses (req: express.Request, res: express.Response) { | 64 | async function listVideoAbuses (req: express.Request, res: express.Response) { |
65 | const resultList = await VideoAbuseModel.listForApi(req.query.start, req.query.count, req.query.sort) | 65 | const user = res.locals.oauth.token.user |
66 | const serverActor = await getServerActor() | ||
67 | |||
68 | const resultList = await VideoAbuseModel.listForApi({ | ||
69 | start: req.query.start, | ||
70 | count: req.query.count, | ||
71 | sort: req.query.sort, | ||
72 | serverAccountId: serverActor.Account.id, | ||
73 | user | ||
74 | }) | ||
66 | 75 | ||
67 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 76 | return res.json(getFormattedObjects(resultList.data, resultList.total)) |
68 | } | 77 | } |