Outbound documents speak Mastodon's dialect under PrivaPub's route names
Local text (Domain/Content/ContentRenderer): Markdig with raw HTML off and
autolinks, or plain text for API clients; then @user and @user@host are
resolved (locally or through WebFinger) into Mastodon's h-card markup and
#tags into hashtag links, skipping code, links and e-mail addresses. A
post stores the result, its mentions and its tags, and is delivered to
the mentioned actors and the parent's author as well as to followers.
Renderer:
- Mastodon's @context (toot, schema PropertyValue, discoverable,
indexable, blurhash, focalPoint, featured, alsoKnownAs, movedTo) and
FEP-2c59's webfinger;
- an actor's url is its HTML page, its fields are PropertyValue
attachments, published is cut to the day and indexable is false;
- a note's content is the stored rendering; a title becomes name and a
bold first line, a content warning without its own text is summarised
by the title or "Content warning"; Mention and Hashtag tags, contentMap,
updated, and to/cc by visibility.
Routes take the agreed names: /groupies, /stalking, /scribbles/{id},
/grunts/{id} (a Create resolves), /whispers/{id} for a DM's context. The
outbox is a collection with a first page, paged by max_id. A browser
asking for an actor or a note is redirected to /@user, and WebFinger's
profile-page points there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
1 parent
e9529310fe
commit
e54e17708f
9 files changed
+590
-74
No files matched your search
@@ -31,18 +31,22 @@ namespace PrivaPub.Federation.Actors
|
||||
public bool IsFederated { get; init; } = true;
|
||||
public DateTime Published { get; init; }
|
||||
public string BaseAddress { get; init; }
|
||||
public IReadOnlyDictionary<string, string> Fields { get; init; } = new Dictionary<string, string>();
|
||||
|
||||
public string Uri => $"{BaseAddress}/peasants/{UserName}";
|
||||
public string KeyId => $"{Uri}#main-key";
|
||||
public string Inbox => $"{Uri}/mouth";
|
||||
public string Outbox => $"{Uri}/anus";
|
||||
public string Followers => $"{Uri}/followers";
|
||||
public string Following => $"{Uri}/following";
|
||||
public string Followers => $"{Uri}/groupies";
|
||||
public string Following => $"{Uri}/stalking";
|
||||
public string SharedInbox => $"{BaseAddress}/human-centipede";
|
||||
public string Domain => new Uri(BaseAddress).Authority;
|
||||
public string Handle => $"{UserName}@{Domain}";
|
||||
public string PostUri(string postId) => $"{Uri}/posts/{postId}";
|
||||
public string ActivityUri(string activityId) => $"{Uri}/activities/{activityId}";
|
||||
public string HtmlUrl => $"{BaseAddress}/@{UserName}";
|
||||
public string PostUri(string postId) => $"{Uri}/scribbles/{postId}";
|
||||
public string PostHtmlUrl(string postId) => $"{HtmlUrl}/{postId}";
|
||||
public string ActivityUri(string activityId) => $"{Uri}/grunts/{activityId}";
|
||||
public string ConversationUri(string conversationId) => $"{Uri}/whispers/{conversationId}";
|
||||
}
|
||||
|
||||
public interface ILocalActorService
|
||||
@@ -190,6 +194,7 @@ namespace PrivaPub.Federation.Actors
|
||||
PrivateKeyPem = avatar.PrivateKey,
|
||||
PublicKeyPem = avatar.PublicKey,
|
||||
Published = avatar.CreatedAt,
|
||||
Fields = avatar.Fields ?? new Dictionary<string, string>(),
|
||||
BaseAddress = BaseAddress
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user