From 9e2a4af3a0d21f93ebc042e0be3666fed947f894 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 25 Jul 2022 11:24:05 +0200 Subject: Use unique AP id for accept/reject --- server/lib/activitypub/send/send-reject.ts | 2 +- server/lib/activitypub/url.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'server/lib') 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) { 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' }) 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 } 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) { -- cgit v1.2.3