From c1e791bad0b079af67398f6407221e6dcbb573dd Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 25 Jul 2018 22:01:25 +0200 Subject: expliciting type checks and predicates (server only) --- server/models/video/video-comment.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models/video') diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index e79aff209..03122dc03 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts @@ -156,7 +156,7 @@ export class VideoCommentModel extends Model { as: 'InReplyToVideoComment', onDelete: 'CASCADE' }) - InReplyToVideoComment: VideoCommentModel + InReplyToVideoComment: VideoCommentModel | null @ForeignKey(() => VideoModel) @Column @@ -417,7 +417,7 @@ export class VideoCommentModel extends Model { toActivityPubObject (threadParentComments: VideoCommentModel[]): VideoCommentObject { let inReplyTo: string // New thread, so in AS we reply to the video - if (this.inReplyToCommentId === null) { + if ((this.inReplyToCommentId !== null) || (this.InReplyToVideoComment !== null)) { inReplyTo = this.Video.url } else { inReplyTo = this.InReplyToVideoComment.url -- cgit v1.2.3