diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-07-25 22:01:25 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2018-07-25 22:01:25 +0200 |
commit | c1e791bad0b079af67398f6407221e6dcbb573dd (patch) | |
tree | 82e5944b4458dd35aa482a38f6b650eb93bb89ad /server/models/video | |
parent | 5f7021c33d31c5255b995ae0ff86b5bbea4ea4b9 (diff) | |
download | PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.tar.gz PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.tar.zst PeerTube-c1e791bad0b079af67398f6407221e6dcbb573dd.zip |
expliciting type checks and predicates (server only)
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video-comment.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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<VideoCommentModel> { | |||
156 | as: 'InReplyToVideoComment', | 156 | as: 'InReplyToVideoComment', |
157 | onDelete: 'CASCADE' | 157 | onDelete: 'CASCADE' |
158 | }) | 158 | }) |
159 | InReplyToVideoComment: VideoCommentModel | 159 | InReplyToVideoComment: VideoCommentModel | null |
160 | 160 | ||
161 | @ForeignKey(() => VideoModel) | 161 | @ForeignKey(() => VideoModel) |
162 | @Column | 162 | @Column |
@@ -417,7 +417,7 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
417 | toActivityPubObject (threadParentComments: VideoCommentModel[]): VideoCommentObject { | 417 | toActivityPubObject (threadParentComments: VideoCommentModel[]): VideoCommentObject { |
418 | let inReplyTo: string | 418 | let inReplyTo: string |
419 | // New thread, so in AS we reply to the video | 419 | // New thread, so in AS we reply to the video |
420 | if (this.inReplyToCommentId === null) { | 420 | if ((this.inReplyToCommentId !== null) || (this.InReplyToVideoComment !== null)) { |
421 | inReplyTo = this.Video.url | 421 | inReplyTo = this.Video.url |
422 | } else { | 422 | } else { |
423 | inReplyTo = this.InReplyToVideoComment.url | 423 | inReplyTo = this.InReplyToVideoComment.url |