R8 the Mastodon API made real: featured tags, endorsements, notes, notify and languages, suggestions, the direct stream

Featured tags per persona (/api/v1/featured_tags, suggestions, tags/:name/feature, accounts' featured tags, max 10),
listed at /tattoos as Hashtags and sent as Add/Remove{Hashtag} to followers on the featured collection, as Mastodon
sends them; remote accounts' tags received and read from featuredTags. Endorsements (pin/endorse) and private notes
(PersonaNote) kept per persona and never federated; the relationship's notifying, languages, endorsed and note, with
follow's notify (status notifications) and languages (home filter). Reading preferences set on /clientapi. Suggestions
v1/v2 with dismissals and staff picks, never the persona or a sibling. conversation events on the direct stream.
translate, annual reports and the admin API answer. New collections backed up and removed with their persona.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-18 08:38:11 +02:00
1 parent d08fbabaa5
commit 87529bca49
42 files changed
+1505 -77

No files matched your search

+3
View File
@@ -64,6 +64,9 @@ namespace PrivaPub.Models
public const string EmojiInsert = "emoji.insert";
public const string EmojiUpdate = "emoji.update";
public const string EmojiDelete = "emoji.delete";
// the accounts suggested to every persona (completion program R8)
public const string StaffPickInsert = "staff_pick.insert";
public const string StaffPickDelete = "staff_pick.delete";
}
public static class AdminTargets
+1 -1
View File
@@ -33,7 +33,7 @@ namespace PrivaPub.Models
public List<ServerRule> Rules { get; set; } = new();//soft-deleted ones stay, so old reports keep their meaning
public List<string> Relays { get; set; } = new();//besides Federation:Relays
public ServerMediaLimits Media { get; set; } = new();
public List<string> StaffPicks { get; set; } = new();//account ids, for later
public List<string> StaffPicks { get; set; } = new();//Mastodon account ids (Avatar.ID, ForeignAvatar.ID) suggested first to every persona (R8)
public bool PublishActivity { get; set; }//GET /api/v1/instance/activity; off by default
public DateTime? UpdatedAt { get; set; }//null: never saved
public string UpdatedBy { get; set; }//the administrator's root id, or "cli"
+64
View File
@@ -0,0 +1,64 @@
using MongoDB.Entities;
namespace PrivaPub.Models.Social
{
// What the Mastodon API keeps per persona since the completion program's R8. Every row here is one persona's, never its
// login's: siblings of one login must never be linkable, so nothing is kept per root.
// A hashtag a persona features on its profile (Mastodon's featured tags). Public: its featuredTags collection
// (/peasants/{name}/tattoos) lists it, and featuring or unfeaturing it is told to its followers as Add or Remove of a
// Hashtag. One per persona and name.
public class FeaturedTag : Entity
{
public string AvatarId { get; set; }
public string Name { get; set; }//normalised: no #, NFKC, lower case (TagsController.Normalise), as posts keep their tags
public string DisplayName { get; set; }//as the persona wrote it (it normalises to Name)
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
// A hashtag an account elsewhere features: its featuredTags collection, read with its counts at most once a day
// (AccountCountsJob), and the Add and Remove of a Hashtag it sends. Shown as its featured tags here; the lowest Position
// first.
public class RemoteFeaturedTag : Entity
{
public string ActorURI { get; set; }
public string Name { get; set; }//normalised, as FeaturedTag.Name
public string DisplayName { get; set; }
public string Href { get; set; }//the Hashtag's own link (its server's page of the account's posts with it), when it gave one
public int Position { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
// An account a persona endorses (Mastodon's account pins, 4.4's endorsements): only one it follows, and only while it
// does. Kept for the persona alone: never federated as featured accounts and never shown to anyone else (the owner's
// default: endorsements stay private).
public class Endorsement : Entity
{
public string AvatarId { get; set; }
public string TargetAccountId { get; set; }//Avatar.ID, Group.ID or ForeignAvatar.ID
public string TargetActorURI { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
// A persona's private note on an account (POST /api/v1/accounts/:id/note): its own, never its login's. RootUserNote is
// keyed by the root and would show a note made as one persona to its siblings. Never federated.
public class PersonaNote : Entity
{
public const int MaxLength = 2000;//Mastodon's AccountNote limit
public string AvatarId { get; set; }
public string TargetAccountId { get; set; }
public string Text { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
// An account a persona took out of its follow suggestions (DELETE /api/v1/suggestions/:account_id): never suggested to
// that persona again.
public class SuggestionDismissal : Entity
{
public string AvatarId { get; set; }
public string AccountId { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
}
+2
View File
@@ -13,6 +13,8 @@ namespace PrivaPub.Models.Social
public FollowState State { get; set; }
public string FollowActivityURI { get; set; }
public bool ShowReblogs { get; set; } = true;
public bool Notify { get; set; }//Mastodon's notify (R8): a `status` notification for each new post of the account
public List<string> Languages { get; set; }//Mastodon's languages (R8): only its posts in these reach the home; null, every language
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public int Resent { get; set; }//how many times a request still unanswered was sent again (FollowService.ResendPending)
public DateTime? ResentAt { get; set; }
+2 -1
View File
@@ -33,6 +33,7 @@ namespace PrivaPub.Models.Social
Poll,
Reaction,
Quote,
ModerationWarning
ModerationWarning,
Status//a new post of an account the persona follows with notify (R8)
}
}
+14
View File
@@ -78,6 +78,7 @@ namespace PrivaPub.Models.User
public string InboxURL { get; set; }
public string OutboxURL { get; set; }
public string FeaturedURL { get; set; }//featured: the posts it pins
public string FeaturedTagsURL { get; set; }//featuredTags: the hashtags it features (R8)
public List<PrivaPub.Models.Post.PostFlair> Flairs { get; set; } = new();//a community's labels for its posts
public List<string> FeedCommunities { get; set; } = new();//a feed's communities, its `following` (Lemmy's multi-communities, PieFed's feeds)
public List<string> SearchableBy { get; set; }//FEP-268d, when the account states it: outranks IsIndexable
@@ -127,6 +128,19 @@ namespace PrivaPub.Models.User
public bool DefaultSensitive { get; set; }
public string DefaultLanguage { get; set; }
public string QuotePolicy { get; set; } = QuotePolicies.Public;//owner decision: anyone may quote a public post, automatically
// how its clients show what others post (R8, Mastodon's reading:expand:media and :spoilers in GET /api/v1/preferences),
// set through /clientapi/avatar/private/preferences, since Mastodon's API sets neither
public string ExpandMedia { get; set; } = ExpandMediaModes.Default;
public bool ExpandSpoilers { get; set; }
}
public static class ExpandMediaModes
{
public const string Default = "default";//hide media marked sensitive
public const string ShowAll = "show_all";
public const string HideAll = "hide_all";
public static bool IsKnown(string value) => value is Default or ShowAll or HideAll;
}
public static class QuotePolicies