Files
SocialPub/PrivaPub/Models/Social/Featuring.cs
T
thepraandClaude Opus 5.5 87529bca49 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
2026-10-18 08:38:11 +02:00

65 lines
3.0 KiB
C#

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;
}
}