diff options
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video-comment.ts | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index b44d65138..869a42afe 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -507,27 +507,30 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
507 | } | 507 | } |
508 | 508 | ||
509 | toActivityPubObject (this: MCommentAP, threadParentComments: MCommentOwner[]): VideoCommentObject | ActivityTombstoneObject { | 509 | toActivityPubObject (this: MCommentAP, threadParentComments: MCommentOwner[]): VideoCommentObject | ActivityTombstoneObject { |
510 | let inReplyTo: string | ||
511 | // New thread, so in AS we reply to the video | ||
512 | if (this.inReplyToCommentId === null) { | ||
513 | inReplyTo = this.Video.url | ||
514 | } else { | ||
515 | inReplyTo = this.InReplyToVideoComment.url | ||
516 | } | ||
517 | |||
510 | if (this.isDeleted()) { | 518 | if (this.isDeleted()) { |
511 | return { | 519 | return { |
512 | id: this.url, | 520 | id: this.url, |
513 | type: 'Tombstone', | 521 | type: 'Tombstone', |
514 | formerType: 'Note', | 522 | formerType: 'Note', |
523 | inReplyTo, | ||
515 | published: this.createdAt.toISOString(), | 524 | published: this.createdAt.toISOString(), |
516 | updated: this.updatedAt.toISOString(), | 525 | updated: this.updatedAt.toISOString(), |
517 | deleted: this.deletedAt.toISOString() | 526 | deleted: this.deletedAt.toISOString() |
518 | } | 527 | } |
519 | } | 528 | } |
520 | 529 | ||
521 | let inReplyTo: string | ||
522 | // New thread, so in AS we reply to the video | ||
523 | if (this.inReplyToCommentId === null) { | ||
524 | inReplyTo = this.Video.url | ||
525 | } else { | ||
526 | inReplyTo = this.InReplyToVideoComment.url | ||
527 | } | ||
528 | |||
529 | const tag: ActivityTagObject[] = [] | 530 | const tag: ActivityTagObject[] = [] |
530 | for (const parentComment of threadParentComments) { | 531 | for (const parentComment of threadParentComments) { |
532 | if (!parentComment.Account) continue | ||
533 | |||
531 | const actor = parentComment.Account.Actor | 534 | const actor = parentComment.Account.Actor |
532 | 535 | ||
533 | tag.push({ | 536 | tag.push({ |