aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-25 11:24:05 +0200
committerChocobozzz <me@florianbigard.com>2022-07-25 11:24:05 +0200
commit9e2a4af3a0d21f93ebc042e0be3666fed947f894 (patch)
treef0869d10fc3311339c5e18bc806bea6f5f2c7971
parent051d69a00582b5ea8677868246ba75fe7933b75e (diff)
downloadPeerTube-9e2a4af3a0d21f93ebc042e0be3666fed947f894.tar.gz
PeerTube-9e2a4af3a0d21f93ebc042e0be3666fed947f894.tar.zst
PeerTube-9e2a4af3a0d21f93ebc042e0be3666fed947f894.zip
Use unique AP id for accept/reject
-rw-r--r--server/lib/activitypub/send/send-reject.ts2
-rw-r--r--server/lib/activitypub/url.ts9
2 files changed, 4 insertions, 7 deletions
diff --git a/server/lib/activitypub/send/send-reject.ts b/server/lib/activitypub/send/send-reject.ts
index 83d8dfba7..a5f8c2ecf 100644
--- a/server/lib/activitypub/send/send-reject.ts
+++ b/server/lib/activitypub/send/send-reject.ts
@@ -15,7 +15,7 @@ function sendReject (followUrl: string, follower: MActor, following: MActor) {
15 15
16 const followData = buildFollowActivity(followUrl, follower, following) 16 const followData = buildFollowActivity(followUrl, follower, following)
17 17
18 const url = getLocalActorFollowRejectActivityPubUrl(follower, following) 18 const url = getLocalActorFollowRejectActivityPubUrl()
19 const data = buildRejectActivity(url, following, followData) 19 const data = buildRejectActivity(url, following, followData)
20 20
21 return unicastTo({ data, byActor: following, toActorUrl: follower.inboxUrl, contextType: 'Reject' }) 21 return unicastTo({ data, byActor: following, toActorUrl: follower.inboxUrl, contextType: 'Reject' })
diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts
index 2f68f7a17..2c32ba056 100644
--- a/server/lib/activitypub/url.ts
+++ b/server/lib/activitypub/url.ts
@@ -93,14 +93,11 @@ function getLocalActorFollowActivityPubUrl (follower: MActor, following: MActorI
93} 93}
94 94
95function getLocalActorFollowAcceptActivityPubUrl (actorFollow: MActorFollowActors) { 95function getLocalActorFollowAcceptActivityPubUrl (actorFollow: MActorFollowActors) {
96 const follower = actorFollow.ActorFollower 96 return WEBSERVER.URL + '/accepts/follows/' + actorFollow.id
97 const me = actorFollow.ActorFollowing
98
99 return WEBSERVER.URL + '/accepts/follows/' + follower.id + '/' + me.id
100} 97}
101 98
102function getLocalActorFollowRejectActivityPubUrl (follower: MActorId, following: MActorId) { 99function getLocalActorFollowRejectActivityPubUrl () {
103 return WEBSERVER.URL + '/rejects/follows/' + follower.id + '/' + following.id 100 return WEBSERVER.URL + '/rejects/follows/' + new Date().toISOString()
104} 101}
105 102
106function getLocalVideoAnnounceActivityPubUrl (byActor: MActorId, video: MVideoUrl) { 103function getLocalVideoAnnounceActivityPubUrl (byActor: MActorId, video: MVideoUrl) {