mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Correctly forward video related activities
This commit is contained in:
parent
3f9b33b02b
commit
9588d4f49b
6 changed files with 43 additions and 18 deletions
|
@ -9,10 +9,9 @@ import { ActorModel } from '../../../models/activitypub/actor'
|
|||
import { VideoAbuseModel } from '../../../models/video/video-abuse'
|
||||
import { VideoCommentModel } from '../../../models/video/video-comment'
|
||||
import { getOrCreateActorAndServerAndModel } from '../actor'
|
||||
import { getActorsInvolvedInVideo } from '../audience'
|
||||
import { resolveThread } from '../video-comments'
|
||||
import { getOrCreateAccountAndVideoAndChannel } from '../videos'
|
||||
import { forwardActivity } from '../send/utils'
|
||||
import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils'
|
||||
|
||||
async function processCreateActivity (activity: ActivityCreate) {
|
||||
const activityObject = activity.object
|
||||
|
@ -87,7 +86,8 @@ async function createVideoDislike (byActor: ActorModel, activity: ActivityCreate
|
|||
if (video.isOwned() && created === true) {
|
||||
// Don't resend the activity to the sender
|
||||
const exceptions = [ byActor ]
|
||||
await forwardActivity(activity, t, exceptions)
|
||||
|
||||
await forwardVideoRelatedActivity(activity, t, exceptions, video)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -190,11 +190,7 @@ async function createVideoComment (byActor: ActorModel, activity: ActivityCreate
|
|||
// Don't resend the activity to the sender
|
||||
const exceptions = [ byActor ]
|
||||
|
||||
// Mastodon does not add our announces in audience, so we forward to them manually
|
||||
const additionalActors = await getActorsInvolvedInVideo(video, t)
|
||||
const additionalFollowerUrls = additionalActors.map(a => a.followersUrl)
|
||||
|
||||
await forwardActivity(activity, t, exceptions, additionalFollowerUrls)
|
||||
await forwardVideoRelatedActivity(activity, t, exceptions, video)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue