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

36 lines
1.4 KiB
C#
Raw Normal View History

using MongoDB.Entities;
namespace PrivaPub.Models.Social
{
// An announcement of the server's administrators (Mastodon's /api/v1/announcements, completion program R5): written in
// Markdown on the administrator's page, shown while published and not ended. Never federated.
public class Announcement : Entity
{
public string Text { get; set; }//Markdown
public string Html { get; set; }//rendered and sanitized (ContentRenderer.Document)
public DateTime? StartsAt { get; set; }//what it is about, if it has a time (as Mastodon's)
public DateTime? EndsAt { get; set; }//once past, it is no longer shown
public bool AllDay { get; set; }
public bool IsPublished { get; set; }
public DateTime? PublishedAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
// a persona dismissed it (Mastodon's read), kept per persona and never told anyone
public class AnnouncementRead : Entity
{
public string AnnouncementId { get; set; }
public string AvatarId { get; set; }
public DateTime ReadAt { get; set; } = DateTime.UtcNow;
}
// a persona's reaction to it (one unicode emoji), counted for everyone, the persona's own known only to it
public class AnnouncementReaction : Entity
{
public string AnnouncementId { get; set; }
public string AvatarId { get; set; }
public string Name { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
}