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:
1 parent
d08fbabaa5
commit
87529bca49
42 files changed
+1505
-77
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user