Fix follow accept rendering
This commit is contained in:
parent
7af8840f2d
commit
471516f729
2 changed files with 19 additions and 8 deletions
|
@ -78,7 +78,9 @@ public class ActivityHandlerService(
|
|||
return;
|
||||
}
|
||||
|
||||
var acceptActivity = activityRenderer.RenderAccept(followeeActor, requestId);
|
||||
var acceptActivity = activityRenderer.RenderAccept(followeeActor,
|
||||
activityRenderer.RenderFollow(followerActor,
|
||||
followeeActor, requestId));
|
||||
var keypair = await db.UserKeypairs.FirstAsync(p => p.User == followee);
|
||||
var payload = await acceptActivity.SignAndCompact(keypair);
|
||||
var inboxUri = follower.SharedInbox ??
|
||||
|
|
|
@ -14,16 +14,25 @@ public class ActivityRenderer(IOptions<Config.InstanceSection> config) {
|
|||
};
|
||||
}
|
||||
|
||||
public ASActivity RenderAccept(ASObject followeeActor, string requestId) {
|
||||
public ASActivity RenderAccept(ASObject actor, ASObject obj) {
|
||||
return new ASActivity {
|
||||
Id = $"https://{config.Value.WebDomain}/activities/{Guid.NewGuid().ToString().ToLowerInvariant()}",
|
||||
Type = "https://www.w3.org/ns/activitystreams#Accept",
|
||||
Actor = new ASActor {
|
||||
Id = followeeActor.Id
|
||||
Id = actor.Id
|
||||
},
|
||||
Object = new ASObject {
|
||||
Id = requestId
|
||||
Object = obj
|
||||
};
|
||||
}
|
||||
|
||||
public ASActivity RenderFollow(ASObject followerActor, ASObject followeeActor, string requestId) {
|
||||
return new ASActivity {
|
||||
Id = requestId,
|
||||
Type = ASActivity.Types.Follow,
|
||||
Actor = new ASActor {
|
||||
Id = followerActor.Id
|
||||
},
|
||||
Object = followeeActor
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue