32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
using MongoDB.Entities;
|
|||
|
|
|
||
|
|
namespace PrivaPub.Models.Social
|
||
|
|
{
|
||
|
|
//a persona's list of accounts it follows (Mastodon lists): a timeline of their posts, and, when exclusive, their posts
|
||
|
|
//kept out of the home timeline. Lists are the persona's own and never federate.
|
||
|
|
public class PersonaList : Entity
|
||
|
|
{
|
||
|
|
public string AvatarId { get; set; }
|
||
|
|
public string Title { get; set; }
|
||
|
|
public string RepliesPolicy { get; set; } = ListRepliesPolicy.List;
|
||
|
|
public bool Exclusive { get; set; }
|
||
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||
|
|
}
|
||
|
|
|
||
|
|
public class PersonaListMember : Entity
|
||
|
|
{
|
||
|
|
public string ListId { get; set; }
|
||
|
|
public string AvatarId { get; set; }//the list's owner
|
||
|
|
public string AccountId { get; set; }//the member: a ForeignAvatar.ID, an Avatar.ID or a community's Group.ID
|
||
|
|
public DateTime AddedAt { get; set; } = DateTime.UtcNow;
|
||
|
|
}
|
||
|
|
|
||
|
|
public static class ListRepliesPolicy
|
||
|
|
{
|
||
|
|
public const string Followed = "followed";//replies to anyone the persona follows
|
||
|
|
public const string List = "list";//replies to members of the list
|
||
|
|
public const string None = "none";
|
||
|
|
|
||
|
|
public static bool IsValid(string value) => value is Followed or List or None;
|
||
|
|
}
|
||
|
|
}
|