diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/api/videos/comment.ts | 2 | ||||
-rw-r--r-- | server/models/video/video-comment.ts | 28 |
2 files changed, 17 insertions, 13 deletions
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts index b21698525..38fa7c3b0 100644 --- a/server/controllers/api/videos/comment.ts +++ b/server/controllers/api/videos/comment.ts | |||
@@ -166,8 +166,6 @@ async function listVideoThreadComments (req: express.Request, res: express.Respo | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | logger.info('coucou', { resultList }) | ||
170 | |||
171 | if (resultList.data.length === 0) { | 169 | if (resultList.data.length === 0) { |
172 | return res.sendStatus(HttpStatusCode.NOT_FOUND_404) | 170 | return res.sendStatus(HttpStatusCode.NOT_FOUND_404) |
173 | } | 171 | } |
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index cfd1d5b7a..dc7556d44 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -483,20 +483,26 @@ export class VideoCommentModel extends Model { | |||
483 | order: [ [ 'createdAt', 'ASC' ], [ 'updatedAt', 'ASC' ] ] as Order, | 483 | order: [ [ 'createdAt', 'ASC' ], [ 'updatedAt', 'ASC' ] ] as Order, |
484 | where: { | 484 | where: { |
485 | videoId, | 485 | videoId, |
486 | [Op.or]: [ | 486 | [Op.and]: [ |
487 | { id: threadId }, | ||
488 | { originCommentId: threadId } | ||
489 | ], | ||
490 | [Op.or]: [ | ||
491 | { | 487 | { |
492 | accountId: { | 488 | [Op.or]: [ |
493 | [Op.notIn]: Sequelize.literal( | 489 | { id: threadId }, |
494 | '(' + buildBlockedAccountSQL(blockerAccountIds) + ')' | 490 | { originCommentId: threadId } |
495 | ) | 491 | ] |
496 | } | ||
497 | }, | 492 | }, |
498 | { | 493 | { |
499 | accountId: null | 494 | [Op.or]: [ |
495 | { | ||
496 | accountId: { | ||
497 | [Op.notIn]: Sequelize.literal( | ||
498 | '(' + buildBlockedAccountSQL(blockerAccountIds) + ')' | ||
499 | ) | ||
500 | } | ||
501 | }, | ||
502 | { | ||
503 | accountId: null | ||
504 | } | ||
505 | ] | ||
500 | } | 506 | } |
501 | ] | 507 | ] |
502 | } | 508 | } |