aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/url.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/url.ts')
-rw-r--r--server/lib/activitypub/url.ts30
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 @@
1import { CONFIG } from '../../initializers/constants' 1import { CONFIG } from '../../initializers'
2import { VideoInstance } from '../../models/video/video-interface' 2import { AccountModel } from '../../models/account/account'
3import { VideoChannelInstance } from '../../models/video/video-channel-interface' 3import { AccountFollowModel } from '../../models/account/account-follow'
4import { VideoAbuseInstance } from '../../models/video/video-abuse-interface' 4import { VideoModel } from '../../models/video/video'
5import { AccountFollowInstance } from '../../models/account/account-follow-interface' 5import { VideoAbuseModel } from '../../models/video/video-abuse'
6import { AccountInstance } from '../../models/account/account-interface' 6import { VideoChannelModel } from '../../models/video/video-channel'
7 7
8function getVideoActivityPubUrl (video: VideoInstance) { 8function 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
12function getVideoChannelActivityPubUrl (videoChannel: VideoChannelInstance) { 12function 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
20function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseInstance) { 20function 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
24function getVideoViewActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { 24function 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
28function getVideoLikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { 28function getVideoLikeActivityPubUrl (byAccount: AccountModel, video: VideoModel) {
29 return byAccount.url + '/likes/' + video.id 29 return byAccount.url + '/likes/' + video.id
30} 30}
31 31
32function getVideoDislikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { 32function getVideoDislikeActivityPubUrl (byAccount: AccountModel, video: VideoModel) {
33 return byAccount.url + '/dislikes/' + video.id 33 return byAccount.url + '/dislikes/' + video.id
34} 34}
35 35
36function getAccountFollowActivityPubUrl (accountFollow: AccountFollowInstance) { 36function 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
43function getAccountFollowAcceptActivityPubUrl (accountFollow: AccountFollowInstance) { 43function 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
50function getAnnounceActivityPubUrl (originalUrl: string, byAccount: AccountInstance) { 50function getAnnounceActivityPubUrl (originalUrl: string, byAccount: AccountModel) {
51 return originalUrl + '/announces/' + byAccount.id 51 return originalUrl + '/announces/' + byAccount.id
52} 52}
53 53