diff options
Diffstat (limited to 'server/lib/activitypub/url.ts')
-rw-r--r-- | server/lib/activitypub/url.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts index bcb7a4ee2..dfcb3c668 100644 --- a/server/lib/activitypub/url.ts +++ b/server/lib/activitypub/url.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { WEBSERVER } from '../../initializers/constants' | 1 | import { WEBSERVER } from '../../initializers/constants' |
2 | import { ActorModel } from '../../models/activitypub/actor' | ||
3 | import { ActorFollowModel } from '../../models/activitypub/actor-follow' | ||
4 | import { VideoModel } from '../../models/video/video' | 2 | import { VideoModel } from '../../models/video/video' |
5 | import { VideoAbuseModel } from '../../models/video/video-abuse' | 3 | import { VideoAbuseModel } from '../../models/video/video-abuse' |
6 | import { VideoCommentModel } from '../../models/video/video-comment' | 4 | import { VideoCommentModel } from '../../models/video/video-comment' |
7 | import { VideoFileModel } from '../../models/video/video-file' | 5 | import { VideoFileModel } from '../../models/video/video-file' |
8 | import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' | 6 | import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' |
9 | import { VideoPlaylistModel } from '../../models/video/video-playlist' | 7 | import { VideoPlaylistModel } from '../../models/video/video-playlist' |
8 | import { ActorModelOnly, ActorModelUrl } from '../../typings/models' | ||
9 | import { ActorFollowModelLight } from '../../typings/models/actor-follow' | ||
10 | 10 | ||
11 | function getVideoActivityPubUrl (video: VideoModel) { | 11 | function getVideoActivityPubUrl (video: VideoModel) { |
12 | return WEBSERVER.URL + '/videos/watch/' + video.uuid | 12 | return WEBSERVER.URL + '/videos/watch/' + video.uuid |
@@ -46,15 +46,15 @@ function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseModel) { | |||
46 | return WEBSERVER.URL + '/admin/video-abuses/' + videoAbuse.id | 46 | return WEBSERVER.URL + '/admin/video-abuses/' + videoAbuse.id |
47 | } | 47 | } |
48 | 48 | ||
49 | function getVideoViewActivityPubUrl (byActor: ActorModel, video: VideoModel) { | 49 | function getVideoViewActivityPubUrl (byActor: ActorModelUrl, video: VideoModel) { |
50 | return byActor.url + '/views/videos/' + video.id + '/' + new Date().toISOString() | 50 | return byActor.url + '/views/videos/' + video.id + '/' + new Date().toISOString() |
51 | } | 51 | } |
52 | 52 | ||
53 | function getVideoLikeActivityPubUrl (byActor: ActorModel, video: VideoModel | { id: number }) { | 53 | function getVideoLikeActivityPubUrl (byActor: ActorModelUrl, video: VideoModel | { id: number }) { |
54 | return byActor.url + '/likes/' + video.id | 54 | return byActor.url + '/likes/' + video.id |
55 | } | 55 | } |
56 | 56 | ||
57 | function getVideoDislikeActivityPubUrl (byActor: ActorModel, video: VideoModel | { id: number }) { | 57 | function getVideoDislikeActivityPubUrl (byActor: ActorModelUrl, video: VideoModel | { id: number }) { |
58 | return byActor.url + '/dislikes/' + video.id | 58 | return byActor.url + '/dislikes/' + video.id |
59 | } | 59 | } |
60 | 60 | ||
@@ -74,22 +74,22 @@ function getVideoDislikesActivityPubUrl (video: VideoModel) { | |||
74 | return video.url + '/dislikes' | 74 | return video.url + '/dislikes' |
75 | } | 75 | } |
76 | 76 | ||
77 | function getActorFollowActivityPubUrl (follower: ActorModel, following: ActorModel) { | 77 | function getActorFollowActivityPubUrl (follower: ActorModelOnly, following: ActorModelOnly) { |
78 | return follower.url + '/follows/' + following.id | 78 | return follower.url + '/follows/' + following.id |
79 | } | 79 | } |
80 | 80 | ||
81 | function getActorFollowAcceptActivityPubUrl (actorFollow: ActorFollowModel) { | 81 | function getActorFollowAcceptActivityPubUrl (actorFollow: ActorFollowModelLight) { |
82 | const follower = actorFollow.ActorFollower | 82 | const follower = actorFollow.ActorFollower |
83 | const me = actorFollow.ActorFollowing | 83 | const me = actorFollow.ActorFollowing |
84 | 84 | ||
85 | return follower.url + '/accepts/follows/' + me.id | 85 | return follower.url + '/accepts/follows/' + me.id |
86 | } | 86 | } |
87 | 87 | ||
88 | function getActorFollowRejectActivityPubUrl (follower: ActorModel, following: ActorModel) { | 88 | function getActorFollowRejectActivityPubUrl (follower: ActorModelOnly, following: ActorModelOnly) { |
89 | return follower.url + '/rejects/follows/' + following.id | 89 | return follower.url + '/rejects/follows/' + following.id |
90 | } | 90 | } |
91 | 91 | ||
92 | function getVideoAnnounceActivityPubUrl (byActor: ActorModel, video: VideoModel) { | 92 | function getVideoAnnounceActivityPubUrl (byActor: ActorModelOnly, video: VideoModel) { |
93 | return video.url + '/announces/' + byActor.id | 93 | return video.url + '/announces/' + byActor.id |
94 | } | 94 | } |
95 | 95 | ||