diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-25 11:24:05 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-25 11:24:05 +0200 |
commit | 9e2a4af3a0d21f93ebc042e0be3666fed947f894 (patch) | |
tree | f0869d10fc3311339c5e18bc806bea6f5f2c7971 /server/lib | |
parent | 051d69a00582b5ea8677868246ba75fe7933b75e (diff) | |
download | PeerTube-9e2a4af3a0d21f93ebc042e0be3666fed947f894.tar.gz PeerTube-9e2a4af3a0d21f93ebc042e0be3666fed947f894.tar.zst PeerTube-9e2a4af3a0d21f93ebc042e0be3666fed947f894.zip |
Use unique AP id for accept/reject
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/send/send-reject.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/url.ts | 9 |
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 | ||
95 | function getLocalActorFollowAcceptActivityPubUrl (actorFollow: MActorFollowActors) { | 95 | function 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 | ||
102 | function getLocalActorFollowRejectActivityPubUrl (follower: MActorId, following: MActorId) { | 99 | function getLocalActorFollowRejectActivityPubUrl () { |
103 | return WEBSERVER.URL + '/rejects/follows/' + follower.id + '/' + following.id | 100 | return WEBSERVER.URL + '/rejects/follows/' + new Date().toISOString() |
104 | } | 101 | } |
105 | 102 | ||
106 | function getLocalVideoAnnounceActivityPubUrl (byActor: MActorId, video: MVideoUrl) { | 103 | function getLocalVideoAnnounceActivityPubUrl (byActor: MActorId, video: MVideoUrl) { |