From 1df8a4d79a491d2ad5bdd9329f37e52cba21238c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 May 2020 14:12:12 +0200 Subject: Fix comments feed with musted accounts --- server/models/video/video-comment.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'server/models/video/video-comment.ts') 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 { return VideoCommentModel.findAndCountAll(query) } - static listForFeed (start: number, count: number, videoId?: number): Bluebird { + static async listForFeed (start: number, count: number, videoId?: number): Promise { + const serverActor = await getServerActor() + const query = { order: [ [ 'createdAt', 'DESC' ] ] as Order, offset: start, limit: count, where: { - deletedAt: null + deletedAt: null, + accountId: { + [Op.notIn]: Sequelize.literal( + '(' + buildBlockedAccountSQL(serverActor.Account.id) + ')' + ) + } }, include: [ { -- cgit v1.2.3