R5 the server's own settings in decePub: instance, rules, announcements, relays, media limits, the staff's log, About
Build / Build (push) Successful in 1m5s
Build / Build (push) Successful in 1m5s
Administration's Pleroma placeholders give way to real sections: Instance (title, descriptions, contact, thumbnail, privacy policy, terms, the weekly activity), Rules, Announcements, Relays, Media limits and the Moderation log, next to Reports, blocked servers (now published or obfuscated), statistics and backups; moderators see Reports and the log. Every save sends the whole settings form built from the latest read, since PrivaPub replaces what it carries. /about shows the server's documents to anyone. The report dialog picks the rules a violation breaks, and reports show them. Announcements show above the feed tabs, dismissed and reacted to, live from the user stream. Login names the server. 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
b8d7858acb
commit
4c88980374
33 files changed
+3743
-239
No files matched your search
@@ -50,6 +50,18 @@ public static class APIs
|
||||
public const string POST_DeletePost = "clientapi/post/delete";
|
||||
public const string GET_ModeratorReports = "clientapi/moderator/reports";
|
||||
public static string POST_M_ResolveReport(string reportId) => $"clientapi/moderator/reports/{Uri.EscapeDataString(reportId)}/resolve";
|
||||
public const string GET_ModeratorLog = "clientapi/moderator/log";
|
||||
public const string GET_AdminSettings = "clientapi/admin/settings";
|
||||
public const string POST_AdminSettings = "clientapi/admin/settings";
|
||||
public const string POST_AdminThumbnail = "clientapi/admin/settings/thumbnail";
|
||||
public const string DELETE_AdminThumbnail = "clientapi/admin/settings/thumbnail";
|
||||
public const string GET_AdminAnnouncements = "clientapi/admin/announcements/list";
|
||||
public const string POST_AdminAnnouncementInsert = "clientapi/admin/announcements/insert";
|
||||
public const string POST_AdminAnnouncementUpdate = "clientapi/admin/announcements/update";
|
||||
public static string POST_M_AdminAnnouncementDelete(string id) => $"clientapi/admin/announcements/delete?id={Uri.EscapeDataString(id)}";
|
||||
public const string GET_AdminRelays = "clientapi/admin/relays";
|
||||
public const string POST_AdminRelayInsert = "clientapi/admin/relays/insert";
|
||||
public static string POST_M_AdminRelayDelete(string address) => $"clientapi/admin/relays/delete?address={Uri.EscapeDataString(address)}";
|
||||
public const string GET_AdminDomainBlocks = "clientapi/admin/domainblocks/list";
|
||||
public const string POST_AdminDomainBlock = "clientapi/admin/domainblocks/insert";
|
||||
public static string POST_M_AdminDomainUnblock(string domain) => $"clientapi/admin/domainblocks/delete?domain={Uri.EscapeDataString(domain)}";
|
||||
@@ -111,6 +123,15 @@ public static class APIs
|
||||
public static string PUT_M_Media(string mediaId) => $"api/v1/media/{Uri.EscapeDataString(mediaId)}";
|
||||
public static string DELETE_M_Media(string mediaId) => $"api/v1/media/{Uri.EscapeDataString(mediaId)}";
|
||||
public const string GET_InstanceV2 = "api/v2/instance";
|
||||
public const string GET_InstanceRules = "api/v1/instance/rules";
|
||||
public const string GET_InstanceExtendedDescription = "api/v1/instance/extended_description";
|
||||
public const string GET_InstancePrivacyPolicy = "api/v1/instance/privacy_policy";
|
||||
public const string GET_InstanceTermsOfService = "api/v1/instance/terms_of_service";
|
||||
public const string GET_InstanceDomainBlocks = "api/v1/instance/domain_blocks";
|
||||
public const string GET_Announcements = "api/v1/announcements";
|
||||
public static string POST_M_DismissAnnouncement(string announcementId) => $"api/v1/announcements/{Uri.EscapeDataString(announcementId)}/dismiss";
|
||||
public static string M_AnnouncementReaction(string announcementId, string emoji) =>
|
||||
$"api/v1/announcements/{Uri.EscapeDataString(announcementId)}/reactions/{Uri.EscapeDataString(emoji)}";
|
||||
public const string DELETE_ProfileAvatar = "api/v1/profile/avatar";
|
||||
public const string DELETE_ProfileHeader = "api/v1/profile/header";
|
||||
public const string GET_AccountLookup = "api/v1/accounts/lookup";
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace decePubClient.Models.Mastodon;
|
||||
|
||||
/// <summary>/api/v1/announcements: what the server's administrators announce, shown while published and not ended, as
|
||||
/// the persona sees it (Read and each reaction's Me are the persona's own; signed out, neither is said).</summary>
|
||||
public class Announcement
|
||||
{
|
||||
public string Id { get; set; }
|
||||
/// <summary>Sanitized HTML, from the administrator's Markdown.</summary>
|
||||
public string Content { get; set; }
|
||||
public DateTime? StartsAt { get; set; }
|
||||
public DateTime? EndsAt { get; set; }
|
||||
public bool AllDay { get; set; }
|
||||
public DateTime PublishedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
/// <summary>Whether the persona dismissed it.</summary>
|
||||
public bool? Read { get; set; }
|
||||
public List<AnnouncementReaction> Reactions { get; set; } = [];
|
||||
}
|
||||
|
||||
/// <summary>A unicode emoji chosen on an announcement, how many personas chose it, and whether this one did.</summary>
|
||||
public class AnnouncementReaction
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Count { get; set; }
|
||||
public bool? Me { get; set; }
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>The streaming API's announcement.reaction payload: the emoji, how many chose it now, and on which.</summary>
|
||||
public class AnnouncementReactionEvent
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int Count { get; set; }
|
||||
public string AnnouncementId { get; set; }
|
||||
}
|
||||
@@ -1,11 +1,39 @@
|
||||
namespace decePubClient.Models.Mastodon;
|
||||
|
||||
/// <summary>/api/v2/instance, the part the client reads: what an upload may be.</summary>
|
||||
/// <summary>/api/v2/instance, the part the client reads: what the server calls itself and says of itself, its contact,
|
||||
/// its rules, and what an upload may be.</summary>
|
||||
public class InstanceV2
|
||||
{
|
||||
public string Domain { get; set; }
|
||||
public string Title { get; set; }
|
||||
/// <summary>The short description, as plain text.</summary>
|
||||
public string Description { get; set; }
|
||||
public InstanceThumbnail Thumbnail { get; set; } = new();
|
||||
public InstanceContact Contact { get; set; } = new();
|
||||
public List<InstanceRule> Rules { get; set; } = [];
|
||||
public InstanceConfiguration Configuration { get; set; } = new();
|
||||
}
|
||||
|
||||
public class InstanceThumbnail
|
||||
{
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Who answers for the server: an address, and the persona its administrator named (null when none).</summary>
|
||||
public class InstanceContact
|
||||
{
|
||||
public string Email { get; set; }
|
||||
public Account Account { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>One of the server's rules (/api/v1/instance/rules and the instance's own), in their order.</summary>
|
||||
public class InstanceRule
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Text { get; set; }
|
||||
public string Hint { get; set; }
|
||||
}
|
||||
|
||||
public class InstanceConfiguration
|
||||
{
|
||||
public MediaConfiguration MediaAttachments { get; set; } = new();
|
||||
@@ -21,3 +49,34 @@ public class MediaConfiguration
|
||||
public long VideoMatrixLimit { get; set; }
|
||||
public int VideoFrameRateLimit { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>/api/v1/instance/extended_description and /privacy_policy: the server's text as sanitized HTML, and when it
|
||||
/// last changed.</summary>
|
||||
public class InstanceDocument
|
||||
{
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
public string Content { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>/api/v1/instance/terms_of_service (Mastodon 4.4): the one version PrivaPub keeps; none while it has none
|
||||
/// (404).</summary>
|
||||
public class TermsOfService
|
||||
{
|
||||
/// <summary>yyyy-MM-dd.</summary>
|
||||
public string EffectiveDate { get; set; }
|
||||
/// <summary>Whether they apply already (false while their date is ahead).</summary>
|
||||
public bool Effective { get; set; }
|
||||
public string Content { get; set; }
|
||||
public string SucceededBy { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>/api/v1/instance/domain_blocks: a block the administrator published; its domain partly starred when it is
|
||||
/// obfuscated, its digest the SHA-256 of the whole name.</summary>
|
||||
public class PublicDomainBlock
|
||||
{
|
||||
public string Domain { get; set; }
|
||||
public string Digest { get; set; }
|
||||
/// <summary>suspend, silence or noop.</summary>
|
||||
public string Severity { get; set; }
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
@@ -254,8 +254,10 @@ public class ReportRequest
|
||||
public string AccountId { get; set; }
|
||||
public List<string> StatusIds { get; set; } = [];
|
||||
public string Comment { get; set; }
|
||||
/// <summary>spam, legal or other.</summary>
|
||||
/// <summary>spam, legal, violation or other.</summary>
|
||||
public string Category { get; set; }
|
||||
/// <summary>The server's rules a violation breaks (only a violation names rules).</summary>
|
||||
public List<string> RuleIds { get; set; } = [];
|
||||
public bool Forward { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
namespace decePubClient.Models.Types
|
||||
{
|
||||
/// <summary>Why an account is reported (Mastodon's categories, without its server rules, which PrivaPub has none of).</summary>
|
||||
/// <summary>Why an account is reported (Mastodon's categories). A violation names the server's rules it breaks.</summary>
|
||||
public enum ReportCategory
|
||||
{
|
||||
Other = 0,
|
||||
Spam = 1,
|
||||
Legal = 2
|
||||
Legal = 2,
|
||||
Violation = 3
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user