diff options
author | Chocobozzz <me@florianbigard.com> | 2018-11-14 15:01:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-11-14 16:32:27 +0100 |
commit | 5c6d985faeef1d6793d3f44ca6374f1a9b722806 (patch) | |
tree | 567e31a84e721bf762189582f92ac2ec5c402bcc /server/lib/activitypub/send/send-create.ts | |
parent | df66d81583e07ce049daeeef1edc6a87b57b3684 (diff) | |
download | PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.tar.gz PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.tar.zst PeerTube-5c6d985faeef1d6793d3f44ca6374f1a9b722806.zip |
Check activities host
Diffstat (limited to 'server/lib/activitypub/send/send-create.ts')
-rw-r--r-- | server/lib/activitypub/send/send-create.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index 285edba3b..e3fca0a17 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts | |||
@@ -95,7 +95,7 @@ async function sendCreateView (byActor: ActorModel, video: VideoModel, t: Transa | |||
95 | logger.info('Creating job to send view of %s.', video.url) | 95 | logger.info('Creating job to send view of %s.', video.url) |
96 | 96 | ||
97 | const url = getVideoViewActivityPubUrl(byActor, video) | 97 | const url = getVideoViewActivityPubUrl(byActor, video) |
98 | const viewActivity = buildViewActivity(byActor, video) | 98 | const viewActivity = buildViewActivity(url, byActor, video) |
99 | 99 | ||
100 | return sendVideoRelatedCreateActivity({ | 100 | return sendVideoRelatedCreateActivity({ |
101 | // Use the server actor to send the view | 101 | // Use the server actor to send the view |
@@ -111,7 +111,7 @@ async function sendCreateDislike (byActor: ActorModel, video: VideoModel, t: Tra | |||
111 | logger.info('Creating job to dislike %s.', video.url) | 111 | logger.info('Creating job to dislike %s.', video.url) |
112 | 112 | ||
113 | const url = getVideoDislikeActivityPubUrl(byActor, video) | 113 | const url = getVideoDislikeActivityPubUrl(byActor, video) |
114 | const dislikeActivity = buildDislikeActivity(byActor, video) | 114 | const dislikeActivity = buildDislikeActivity(url, byActor, video) |
115 | 115 | ||
116 | return sendVideoRelatedCreateActivity({ | 116 | return sendVideoRelatedCreateActivity({ |
117 | byActor, | 117 | byActor, |
@@ -136,16 +136,18 @@ function buildCreateActivity (url: string, byActor: ActorModel, object: any, aud | |||
136 | ) | 136 | ) |
137 | } | 137 | } |
138 | 138 | ||
139 | function buildDislikeActivity (byActor: ActorModel, video: VideoModel) { | 139 | function buildDislikeActivity (url: string, byActor: ActorModel, video: VideoModel) { |
140 | return { | 140 | return { |
141 | id: url, | ||
141 | type: 'Dislike', | 142 | type: 'Dislike', |
142 | actor: byActor.url, | 143 | actor: byActor.url, |
143 | object: video.url | 144 | object: video.url |
144 | } | 145 | } |
145 | } | 146 | } |
146 | 147 | ||
147 | function buildViewActivity (byActor: ActorModel, video: VideoModel) { | 148 | function buildViewActivity (url: string, byActor: ActorModel, video: VideoModel) { |
148 | return { | 149 | return { |
150 | id: url, | ||
149 | type: 'View', | 151 | type: 'View', |
150 | actor: byActor.url, | 152 | actor: byActor.url, |
151 | object: video.url | 153 | object: video.url |