Files
SocialPub/PrivaPub/Models/Social/Featuring.cs
T

64 lines
3.0 KiB
C#
Raw Normal View History

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