diff options
Diffstat (limited to 'server/lib/activitypub/url.ts')
-rw-r--r-- | server/lib/activitypub/url.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts index 6475c4218..00b4e8852 100644 --- a/server/lib/activitypub/url.ts +++ b/server/lib/activitypub/url.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import { CONFIG } from '../../initializers/constants' | 1 | import { CONFIG } from '../../initializers' |
2 | import { VideoInstance } from '../../models/video/video-interface' | 2 | import { AccountModel } from '../../models/account/account' |
3 | import { VideoChannelInstance } from '../../models/video/video-channel-interface' | 3 | import { AccountFollowModel } from '../../models/account/account-follow' |
4 | import { VideoAbuseInstance } from '../../models/video/video-abuse-interface' | 4 | import { VideoModel } from '../../models/video/video' |
5 | import { AccountFollowInstance } from '../../models/account/account-follow-interface' | 5 | import { VideoAbuseModel } from '../../models/video/video-abuse' |
6 | import { AccountInstance } from '../../models/account/account-interface' | 6 | import { VideoChannelModel } from '../../models/video/video-channel' |
7 | 7 | ||
8 | function getVideoActivityPubUrl (video: VideoInstance) { | 8 | function getVideoActivityPubUrl (video: VideoModel) { |
9 | return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid | 9 | return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid |
10 | } | 10 | } |
11 | 11 | ||
12 | function getVideoChannelActivityPubUrl (videoChannel: VideoChannelInstance) { | 12 | function getVideoChannelActivityPubUrl (videoChannel: VideoChannelModel) { |
13 | return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannel.uuid | 13 | return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannel.uuid |
14 | } | 14 | } |
15 | 15 | ||
@@ -17,37 +17,37 @@ function getAccountActivityPubUrl (accountName: string) { | |||
17 | return CONFIG.WEBSERVER.URL + '/account/' + accountName | 17 | return CONFIG.WEBSERVER.URL + '/account/' + accountName |
18 | } | 18 | } |
19 | 19 | ||
20 | function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseInstance) { | 20 | function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseModel) { |
21 | return CONFIG.WEBSERVER.URL + '/admin/video-abuses/' + videoAbuse.id | 21 | return CONFIG.WEBSERVER.URL + '/admin/video-abuses/' + videoAbuse.id |
22 | } | 22 | } |
23 | 23 | ||
24 | function getVideoViewActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { | 24 | function getVideoViewActivityPubUrl (byAccount: AccountModel, video: VideoModel) { |
25 | return video.url + '/views/' + byAccount.uuid + '/' + new Date().toISOString() | 25 | return video.url + '/views/' + byAccount.uuid + '/' + new Date().toISOString() |
26 | } | 26 | } |
27 | 27 | ||
28 | function getVideoLikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { | 28 | function getVideoLikeActivityPubUrl (byAccount: AccountModel, video: VideoModel) { |
29 | return byAccount.url + '/likes/' + video.id | 29 | return byAccount.url + '/likes/' + video.id |
30 | } | 30 | } |
31 | 31 | ||
32 | function getVideoDislikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { | 32 | function getVideoDislikeActivityPubUrl (byAccount: AccountModel, video: VideoModel) { |
33 | return byAccount.url + '/dislikes/' + video.id | 33 | return byAccount.url + '/dislikes/' + video.id |
34 | } | 34 | } |
35 | 35 | ||
36 | function getAccountFollowActivityPubUrl (accountFollow: AccountFollowInstance) { | 36 | function getAccountFollowActivityPubUrl (accountFollow: AccountFollowModel) { |
37 | const me = accountFollow.AccountFollower | 37 | const me = accountFollow.AccountFollower |
38 | const following = accountFollow.AccountFollowing | 38 | const following = accountFollow.AccountFollowing |
39 | 39 | ||
40 | return me.url + '/follows/' + following.id | 40 | return me.url + '/follows/' + following.id |
41 | } | 41 | } |
42 | 42 | ||
43 | function getAccountFollowAcceptActivityPubUrl (accountFollow: AccountFollowInstance) { | 43 | function getAccountFollowAcceptActivityPubUrl (accountFollow: AccountFollowModel) { |
44 | const follower = accountFollow.AccountFollower | 44 | const follower = accountFollow.AccountFollower |
45 | const me = accountFollow.AccountFollowing | 45 | const me = accountFollow.AccountFollowing |
46 | 46 | ||
47 | return follower.url + '/accepts/follows/' + me.id | 47 | return follower.url + '/accepts/follows/' + me.id |
48 | } | 48 | } |
49 | 49 | ||
50 | function getAnnounceActivityPubUrl (originalUrl: string, byAccount: AccountInstance) { | 50 | function getAnnounceActivityPubUrl (originalUrl: string, byAccount: AccountModel) { |
51 | return originalUrl + '/announces/' + byAccount.id | 51 | return originalUrl + '/announces/' + byAccount.id |
52 | } | 52 | } |
53 | 53 | ||