From 51f2c10c6f87f4453649c3837ec0bb595147f648 Mon Sep 17 00:00:00 2001 From: thepra Date: Thu, 1 Oct 2026 12:31:13 +0200 Subject: [PATCH] Community actors name their moderators the way Lemmy reads them attributedTo points at /wardens and postingRestrictedToMods reflects the posting policy. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB --- FEDERATION.md | 2 +- PrivaPub/Federation/Rendering/ActivityPubRenderer.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FEDERATION.md b/FEDERATION.md index 2b5be0d..54bb560 100644 --- a/FEDERATION.md +++ b/FEDERATION.md @@ -52,7 +52,7 @@ A group is either a **community** or a **circle**. moderators only) and the group `Announce`s the whole activity, with `audience` set, to its followers. A new post is also announced as an object so Mastodon shows it. Updates and deletes of community content are announced too. A top-level post is a `Page` with a `name`. Members are counted at `/flock`; moderators are listed at `/wardens`, which - `attributedTo` does not yet point to. A mention of a community posts into it. + the actor's `attributedTo` points to, with `postingRestrictedToMods` as Lemmy expects. A mention of a community posts into it. - A **circle** is private. Its actor is not discoverable and every follow is a request. Its posts are addressed to the circle and its members collection, delivered to each member's own inbox and never announced. They are served only to a signed request from a member, or from the instance actor of a member's server; anyone else gets 404. A diff --git a/PrivaPub/Federation/Rendering/ActivityPubRenderer.cs b/PrivaPub/Federation/Rendering/ActivityPubRenderer.cs index e6d7712..6c68444 100644 --- a/PrivaPub/Federation/Rendering/ActivityPubRenderer.cs +++ b/PrivaPub/Federation/Rendering/ActivityPubRenderer.cs @@ -97,6 +97,11 @@ namespace PrivaPub.Federation.Rendering ["value"] = FieldValue(field.Value) }).ToArray()) }; + if (actor is { Kind: LocalActorKind.Group, IsCircle: false }) + { + document["attributedTo"] = actor.Wardens; + document["postingRestrictedToMods"] = actor.PostingRestrictedToModerators; + } if (!string.IsNullOrEmpty(actor.PictureURL)) document["icon"] = new JsonObject { ["type"] = "Image", ["url"] = actor.PictureURL }; if (!string.IsNullOrEmpty(actor.ThumbnailURL))