Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Merge branch 'feature/correctly-send-activities' into develop

Chocobozzz28f3d1b36a70
diff --cc server/controllers/activitypub/client.ts
index 32a83aa5f6,7e87f6f3ba..31c0a5fbd8
--- a/server/controllers/activitypub/client.ts
+++ b/server/controllers/activitypub/client.ts
@@@ -37,9 -33,10 +33,10 @@@ import
getVideoSharesActivityPubUrl
} from '../../lib/activitypub'
import { VideoCaptionModel } from '../../models/video/video-caption'
-import { videoRedundancyGetValidator } from '../../middlewares/validators/redundancy'
+import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy'
import { getServerActor } from '../../helpers/utils'
import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
+ import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike'
const activityPubClientRouter = express.Router()
diff --cc server/lib/activitypub/send/send-create.ts
index 605aaba066,73e667ad42..ef20e404c4
--- a/server/lib/activitypub/send/send-create.ts
+++ b/server/lib/activitypub/send/send-create.ts
@@@ -25,23 -23,12 +23,9 @@@ async function sendCreateVideo (video:
return broadcastToFollowers(createActivity, byActor, [ byActor ], t)
}
- async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel, video: VideoModel) {
- if (!video.VideoChannel.Account.Actor.serverId) return // Local
-
- const url = getVideoAbuseActivityPubUrl(videoAbuse)
-
- logger.info('Creating job to send video abuse %s.', url)
-
- // Custom audience, we only send the abuse to the origin instance
- const audience = { to: [ video.VideoChannel.Account.Actor.url ], cc: [] }
- const createActivity = buildCreateActivity(url, byActor, videoAbuse.toActivityPubObject(), audience)
-
- return unicastTo(createActivity, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl)
- }
-
-async function sendCreateCacheFile (byActor: ActorModel, fileRedundancy: VideoRedundancyModel) {
+async function sendCreateCacheFile (byActor: ActorModel, video: VideoModel, fileRedundancy: VideoRedundancyModel) {
logger.info('Creating job to send file cache of %s.', fileRedundancy.url)
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(fileRedundancy.VideoFile.Video.id)
- const redundancyObject = fileRedundancy.toActivityPubObject()
-
return sendVideoRelatedCreateActivity({
byActor,
video,