]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/url.ts
Add context on activitypub responses
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / url.ts
index bb2d4d11e7b4dfc6f15600c42365af9937f6a1da..5705afbd62ff8ebdbe938439fe406205b47ad216 100644 (file)
@@ -3,21 +3,22 @@ import { ActorModel } from '../../models/activitypub/actor'
 import { ActorFollowModel } from '../../models/activitypub/actor-follow'
 import { VideoModel } from '../../models/video/video'
 import { VideoAbuseModel } from '../../models/video/video-abuse'
+import { VideoCommentModel } from '../../models/video/video-comment'
 
 function getVideoActivityPubUrl (video: VideoModel) {
   return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid
 }
 
-function getVideoChannelActivityPubUrl (videoChannelUUID: string) {
-  return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannelUUID
+function getVideoCommentActivityPubUrl (video: VideoModel, videoComment: VideoCommentModel) {
+  return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid + '/comments/' + videoComment.id
 }
 
-function getApplicationActivityPubUrl () {
-  return CONFIG.WEBSERVER.URL + '/application/peertube'
+function getVideoChannelActivityPubUrl (videoChannelUUID: string) {
+  return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannelUUID
 }
 
 function getAccountActivityPubUrl (accountName: string) {
-  return CONFIG.WEBSERVER.URL + '/account/' + accountName
+  return CONFIG.WEBSERVER.URL + '/accounts/' + accountName
 }
 
 function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseModel) {
@@ -54,6 +55,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
 }
@@ -63,7 +68,6 @@ function getUndoActivityPubUrl (originalUrl: string) {
 }
 
 export {
-  getApplicationActivityPubUrl,
   getVideoActivityPubUrl,
   getVideoChannelActivityPubUrl,
   getAccountActivityPubUrl,
@@ -75,5 +79,7 @@ export {
   getUndoActivityPubUrl,
   getVideoViewActivityPubUrl,
   getVideoLikeActivityPubUrl,
-  getVideoDislikeActivityPubUrl
+  getVideoDislikeActivityPubUrl,
+  getVideoCommentActivityPubUrl,
+  getDeleteActivityPubUrl
 }