aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/abuse.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-29 14:31:04 +0200
committerChocobozzz <me@florianbigard.com>2019-08-29 14:31:04 +0200
commitf0a47bc92aa20b91b46197a4d3fc430aea962848 (patch)
tree104bb5dd7facc0d4db09c7deeea9e189f930e72e /server/controllers/api/videos/abuse.ts
parent3155c8606cff211f495bf71c75c56cae85a5430f (diff)
downloadPeerTube-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.ts13
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared' 2import { UserRight, VideoAbuseCreate, VideoAbuseState } from '../../../../shared'
3import { logger } from '../../../helpers/logger' 3import { logger } from '../../../helpers/logger'
4import { getFormattedObjects } from '../../../helpers/utils' 4import { getFormattedObjects, getServerActor } from '../../../helpers/utils'
5import { sequelizeTypescript } from '../../../initializers' 5import { sequelizeTypescript } from '../../../initializers'
6import { 6import {
7 asyncMiddleware, 7 asyncMiddleware,
@@ -62,7 +62,16 @@ export {
62// --------------------------------------------------------------------------- 62// ---------------------------------------------------------------------------
63 63
64async function listVideoAbuses (req: express.Request, res: express.Response) { 64async 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}