]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Use unique AP id for accept/reject
authorChocobozzz <me@florianbigard.com>
Mon, 25 Jul 2022 09:24:05 +0000 (11:24 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 25 Jul 2022 09:24:05 +0000 (11:24 +0200)
server/lib/activitypub/send/send-reject.ts
server/lib/activitypub/url.ts

index 83d8dfba72366e78888216535a0aec006b2c32de..a5f8c2ecfc75b55df4735788cba33e2ef5f4b96b 100644 (file)
@@ -15,7 +15,7 @@ function sendReject (followUrl: string, follower: MActor, following: MActor) {
 
   const followData = buildFollowActivity(followUrl, follower, following)
 
-  const url = getLocalActorFollowRejectActivityPubUrl(follower, following)
+  const url = getLocalActorFollowRejectActivityPubUrl()
   const data = buildRejectActivity(url, following, followData)
 
   return unicastTo({ data, byActor: following, toActorUrl: follower.inboxUrl, contextType: 'Reject' })
index 2f68f7a17017d8925d7454c47c176835bddb8d4f..2c32ba056c1c069a9dd73d4f95bbb8ee0faae364 100644 (file)
@@ -93,14 +93,11 @@ function getLocalActorFollowActivityPubUrl (follower: MActor, following: MActorI
 }
 
 function getLocalActorFollowAcceptActivityPubUrl (actorFollow: MActorFollowActors) {
-  const follower = actorFollow.ActorFollower
-  const me = actorFollow.ActorFollowing
-
-  return WEBSERVER.URL + '/accepts/follows/' + follower.id + '/' + me.id
+  return WEBSERVER.URL + '/accepts/follows/' + actorFollow.id
 }
 
-function getLocalActorFollowRejectActivityPubUrl (follower: MActorId, following: MActorId) {
-  return WEBSERVER.URL + '/rejects/follows/' + follower.id + '/' + following.id
+function getLocalActorFollowRejectActivityPubUrl () {
+  return WEBSERVER.URL + '/rejects/follows/' + new Date().toISOString()
 }
 
 function getLocalVideoAnnounceActivityPubUrl (byActor: MActorId, video: MVideoUrl) {