}
toActivityPubObject (this: MCommentAP, threadParentComments: MCommentOwner[]): VideoCommentObject | ActivityTombstoneObject {
+ let inReplyTo: string
+ // New thread, so in AS we reply to the video
+ if (this.inReplyToCommentId === null) {
+ inReplyTo = this.Video.url
+ } else {
+ inReplyTo = this.InReplyToVideoComment.url
+ }
+
if (this.isDeleted()) {
return {
id: this.url,
type: 'Tombstone',
formerType: 'Note',
+ inReplyTo,
published: this.createdAt.toISOString(),
updated: this.updatedAt.toISOString(),
deleted: this.deletedAt.toISOString()
}
}
- let inReplyTo: string
- // New thread, so in AS we reply to the video
- if (this.inReplyToCommentId === null) {
- inReplyTo = this.Video.url
- } else {
- inReplyTo = this.InReplyToVideoComment.url
- }
-
const tag: ActivityTagObject[] = []
for (const parentComment of threadParentComments) {
+ if (!parentComment.Account) continue
+
const actor = parentComment.Account.Actor
tag.push({