diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-06 14:12:12 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-06 14:12:12 +0200 |
commit | 1df8a4d79a491d2ad5bdd9329f37e52cba21238c (patch) | |
tree | 4d678958352f1d6044c2ef9fe052f66d323a01b0 /server/models/video/video-comment.ts | |
parent | f375bb3db401e42b4317545a7e40dcfda692604d (diff) | |
download | PeerTube-1df8a4d79a491d2ad5bdd9329f37e52cba21238c.tar.gz PeerTube-1df8a4d79a491d2ad5bdd9329f37e52cba21238c.tar.zst PeerTube-1df8a4d79a491d2ad5bdd9329f37e52cba21238c.zip |
Fix comments feed with musted accounts
Diffstat (limited to 'server/models/video/video-comment.ts')
-rw-r--r-- | server/models/video/video-comment.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index b7ed6240e..6d60271e6 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -381,13 +381,20 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
381 | return VideoCommentModel.findAndCountAll<MComment>(query) | 381 | return VideoCommentModel.findAndCountAll<MComment>(query) |
382 | } | 382 | } |
383 | 383 | ||
384 | static listForFeed (start: number, count: number, videoId?: number): Bluebird<MCommentOwnerVideoFeed[]> { | 384 | static async listForFeed (start: number, count: number, videoId?: number): Promise<MCommentOwnerVideoFeed[]> { |
385 | const serverActor = await getServerActor() | ||
386 | |||
385 | const query = { | 387 | const query = { |
386 | order: [ [ 'createdAt', 'DESC' ] ] as Order, | 388 | order: [ [ 'createdAt', 'DESC' ] ] as Order, |
387 | offset: start, | 389 | offset: start, |
388 | limit: count, | 390 | limit: count, |
389 | where: { | 391 | where: { |
390 | deletedAt: null | 392 | deletedAt: null, |
393 | accountId: { | ||
394 | [Op.notIn]: Sequelize.literal( | ||
395 | '(' + buildBlockedAccountSQL(serverActor.Account.id) + ')' | ||
396 | ) | ||
397 | } | ||
391 | }, | 398 | }, |
392 | include: [ | 399 | include: [ |
393 | { | 400 | { |