]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/url.ts
Fix undo like/dislike forwarding
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / url.ts
index d98561e3328874119c325a5ccb26bcc04885a624..6475c4218c3aa412e473656600e61023129e0546 100644 (file)
@@ -22,29 +22,37 @@ function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseInstance) {
 }
 
 function getVideoViewActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) {
-  return video.url + '#views/' + byAccount.uuid + '/' + new Date().toISOString()
+  return video.url + '/views/' + byAccount.uuid + '/' + new Date().toISOString()
+}
+
+function getVideoLikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) {
+  return byAccount.url + '/likes/' + video.id
+}
+
+function getVideoDislikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) {
+  return byAccount.url + '/dislikes/' + video.id
 }
 
 function getAccountFollowActivityPubUrl (accountFollow: AccountFollowInstance) {
   const me = accountFollow.AccountFollower
   const following = accountFollow.AccountFollowing
 
-  return me.url + '#follows/' + following.id
+  return me.url + '/follows/' + following.id
 }
 
 function getAccountFollowAcceptActivityPubUrl (accountFollow: AccountFollowInstance) {
   const follower = accountFollow.AccountFollower
   const me = accountFollow.AccountFollowing
 
-  return follower.url + '#accepts/follows/' + me.id
+  return follower.url + '/accepts/follows/' + me.id
 }
 
 function getAnnounceActivityPubUrl (originalUrl: string, byAccount: AccountInstance) {
-  return originalUrl + '#announces/' + byAccount.id
+  return originalUrl + '/announces/' + byAccount.id
 }
 
 function getUpdateActivityPubUrl (originalUrl: string, updatedAt: string) {
-  return originalUrl + '#updates/' + updatedAt
+  return originalUrl + '/updates/' + updatedAt
 }
 
 function getUndoActivityPubUrl (originalUrl: string) {
@@ -61,5 +69,7 @@ export {
   getAnnounceActivityPubUrl,
   getUpdateActivityPubUrl,
   getUndoActivityPubUrl,
-  getVideoViewActivityPubUrl
+  getVideoViewActivityPubUrl,
+  getVideoLikeActivityPubUrl,
+  getVideoDislikeActivityPubUrl
 }