]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/url.ts
Refractor comment creation from federation
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / url.ts
index 3d5f0523cfd4bb17daeaa15ba6737838c903a74b..262463310bd0ad3fa21ff9961c895140e60e7c1a 100644 (file)
@@ -13,12 +13,12 @@ function getVideoCommentActivityPubUrl (video: VideoModel, videoComment: VideoCo
   return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid + '/comments/' + videoComment.id
 }
 
-function getVideoChannelActivityPubUrl (videoChannelUUID: string) {
-  return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannelUUID
+function getVideoChannelActivityPubUrl (videoChannelName: string) {
+  return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannelName
 }
 
 function getAccountActivityPubUrl (accountName: string) {
-  return CONFIG.WEBSERVER.URL + '/account/' + accountName
+  return CONFIG.WEBSERVER.URL + '/accounts/' + accountName
 }
 
 function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseModel) {
@@ -37,6 +37,22 @@ function getVideoDislikeActivityPubUrl (byActor: ActorModel, video: VideoModel)
   return byActor.url + '/dislikes/' + video.id
 }
 
+function getVideoSharesActivityPubUrl (video: VideoModel) {
+  return video.url + '/announces'
+}
+
+function getVideoCommentsActivityPubUrl (video: VideoModel) {
+  return video.url + '/comments'
+}
+
+function getVideoLikesActivityPubUrl (video: VideoModel) {
+  return video.url + '/likes'
+}
+
+function getVideoDislikesActivityPubUrl (video: VideoModel) {
+  return video.url + '/dislikes'
+}
+
 function getActorFollowActivityPubUrl (actorFollow: ActorFollowModel) {
   const me = actorFollow.ActorFollower
   const following = actorFollow.ActorFollowing
@@ -55,6 +71,10 @@ function getAnnounceActivityPubUrl (originalUrl: string, byActor: ActorModel) {
   return originalUrl + '/announces/' + byActor.id
 }
 
+function getDeleteActivityPubUrl (originalUrl: string) {
+  return originalUrl + '/delete'
+}
+
 function getUpdateActivityPubUrl (originalUrl: string, updatedAt: string) {
   return originalUrl + '/updates/' + updatedAt
 }
@@ -76,5 +96,10 @@ export {
   getVideoViewActivityPubUrl,
   getVideoLikeActivityPubUrl,
   getVideoDislikeActivityPubUrl,
-  getVideoCommentActivityPubUrl
+  getVideoCommentActivityPubUrl,
+  getDeleteActivityPubUrl,
+  getVideoSharesActivityPubUrl,
+  getVideoCommentsActivityPubUrl,
+  getVideoLikesActivityPubUrl,
+  getVideoDislikesActivityPubUrl
 }