Build / Build (push) Successful in 1m3s
A singleton ServerSettings (title, descriptions, contact, thumbnail, privacy policy, terms, rules, relays, media overrides, PublishActivity), cached by InstanceSettings and read by the instance API, NodeInfo, the instance actor, the web pages and the mailer; its defaults are the old literals, so nothing changes until an administrator edits. /clientapi/admin/settings (and /thumbnail), /announcements, /relays for administrators; /clientapi/moderator/log, the staff's log (AdminAction, written by domain blocks, backups, settings and the CLI; no IP, never a root paired with its personas). The Mastodon API's rules, extended description, privacy policy, terms of service, domain blocks (Published, Obfuscate), announcements (dismiss, reactions, streaming) and activity (only when published). Reports carry rule ids. Media overrides clamped to hard caps. Relays named by the settings reconcile next to the configured ones. Verified: interop.sh instance accounts relay with mastodon, relay, aoderelay and mailpit, 119 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
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;
|
|
}
|
|
}
|