diff options
author | Chocobozzz <me@florianbigard.com> | 2019-02-11 11:00:09 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-02-11 11:00:09 +0100 |
commit | 28f3d1b36a70426795240c9370e47b6c4ba847f8 (patch) | |
tree | fccd90a94deeab6e5ffc3b646280d5cba751c513 /server/controllers/activitypub | |
parent | b426edd4854adc6e65844d8c54b8998e792b5778 (diff) | |
parent | 1e7eb25f6cb6893db8f99ff40ef0509aa2a16614 (diff) | |
download | PeerTube-28f3d1b36a70426795240c9370e47b6c4ba847f8.tar.gz PeerTube-28f3d1b36a70426795240c9370e47b6c4ba847f8.tar.zst PeerTube-28f3d1b36a70426795240c9370e47b6c4ba847f8.zip |
Merge branch 'feature/correctly-send-activities' into develop
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r-- | server/controllers/activitypub/client.ts | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index 32a83aa5f..31c0a5fbd 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts | |||
@@ -3,22 +3,18 @@ import * as express from 'express' | |||
3 | import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' | 3 | import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' |
4 | import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub' | 4 | import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub' |
5 | import { CONFIG, ROUTE_CACHE_LIFETIME } from '../../initializers' | 5 | import { CONFIG, ROUTE_CACHE_LIFETIME } from '../../initializers' |
6 | import { buildAnnounceWithVideoAudience, buildDislikeActivity, buildLikeActivity } from '../../lib/activitypub/send' | 6 | import { buildAnnounceWithVideoAudience, buildLikeActivity } from '../../lib/activitypub/send' |
7 | import { audiencify, getAudience } from '../../lib/activitypub/audience' | 7 | import { audiencify, getAudience } from '../../lib/activitypub/audience' |
8 | import { buildCreateActivity } from '../../lib/activitypub/send/send-create' | 8 | import { buildCreateActivity } from '../../lib/activitypub/send/send-create' |
9 | import { | 9 | import { |
10 | asyncMiddleware, | 10 | asyncMiddleware, |
11 | videosShareValidator, | ||
12 | executeIfActivityPub, | 11 | executeIfActivityPub, |
13 | localAccountValidator, | 12 | localAccountValidator, |
14 | localVideoChannelValidator, | 13 | localVideoChannelValidator, |
15 | videosCustomGetValidator | 14 | videosCustomGetValidator, |
15 | videosShareValidator | ||
16 | } from '../../middlewares' | 16 | } from '../../middlewares' |
17 | import { | 17 | import { getAccountVideoRateValidator, videoCommentGetValidator, videosGetValidator } from '../../middlewares/validators' |
18 | getAccountVideoRateValidator, | ||
19 | videoCommentGetValidator, | ||
20 | videosGetValidator | ||
21 | } from '../../middlewares/validators' | ||
22 | import { AccountModel } from '../../models/account/account' | 18 | import { AccountModel } from '../../models/account/account' |
23 | import { ActorModel } from '../../models/activitypub/actor' | 19 | import { ActorModel } from '../../models/activitypub/actor' |
24 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' | 20 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' |
@@ -40,6 +36,7 @@ import { VideoCaptionModel } from '../../models/video/video-caption' | |||
40 | import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy' | 36 | import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy' |
41 | import { getServerActor } from '../../helpers/utils' | 37 | import { getServerActor } from '../../helpers/utils' |
42 | import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' | 38 | import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' |
39 | import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike' | ||
43 | 40 | ||
44 | const activityPubClientRouter = express.Router() | 41 | const activityPubClientRouter = express.Router() |
45 | 42 | ||
@@ -160,7 +157,7 @@ function getAccountVideoRate (rateType: VideoRateType) { | |||
160 | const url = getRateUrl(rateType, byActor, accountVideoRate.Video) | 157 | const url = getRateUrl(rateType, byActor, accountVideoRate.Video) |
161 | const APObject = rateType === 'like' | 158 | const APObject = rateType === 'like' |
162 | ? buildLikeActivity(url, byActor, accountVideoRate.Video) | 159 | ? buildLikeActivity(url, byActor, accountVideoRate.Video) |
163 | : buildCreateActivity(url, byActor, buildDislikeActivity(url, byActor, accountVideoRate.Video)) | 160 | : buildDislikeActivity(url, byActor, accountVideoRate.Video) |
164 | 161 | ||
165 | return activityPubResponse(activityPubContextify(APObject), res) | 162 | return activityPubResponse(activityPubContextify(APObject), res) |
166 | } | 163 | } |