🐛 Fix accept follow request in AP

This commit is contained in:
2026-01-01 01:28:29 +08:00
parent 78f1d0ecd3
commit d07e33cb75
2 changed files with 8 additions and 5 deletions

View File

@@ -163,8 +163,7 @@ public class ActivityPubActivityHandler(
await deliveryService.SendAcceptActivityAsync( await deliveryService.SendAcceptActivityAsync(
targetActor, targetActor,
actorUri, actorUri
activityId ?? ""
); );
logger.LogInformation("Handled follow from {Actor} to {Target}. RelationshipState: Accepted", logger.LogInformation("Handled follow from {Actor} to {Target}. RelationshipState: Accepted",

View File

@@ -18,8 +18,7 @@ public class ActivityPubDeliveryService(
public async Task<bool> SendAcceptActivityAsync( public async Task<bool> SendAcceptActivityAsync(
SnFediverseActor actor, SnFediverseActor actor,
string followerActorUri, string followerActorUri
string followActivityId
) )
{ {
var actorUrl = actor.Uri; var actorUrl = actor.Uri;
@@ -38,7 +37,12 @@ public class ActivityPubDeliveryService(
["id"] = $"{actorUrl}/accepts/{Guid.NewGuid()}", ["id"] = $"{actorUrl}/accepts/{Guid.NewGuid()}",
["type"] = "Accept", ["type"] = "Accept",
["actor"] = actorUrl, ["actor"] = actorUrl,
["object"] = followActivityId ["object"] = new Dictionary<string, object>
{
["type"] = "Follow",
["actor"] = followerActorUri,
["object"] = actorUrl
}
}; };
return await EnqueueActivityDeliveryAsync("Accept", activity, actorUrl, followerActor.InboxUri); return await EnqueueActivityDeliveryAsync("Accept", activity, actorUrl, followerActor.InboxUri);