2026-10-04 11:03:14 +02:00
|
|
|
namespace decePubClient.Models.Mastodon;
|
|
|
|
|
|
|
|
|
|
/// <summary>A persona, a remote account or a community, as PrivaPub's Mastodon API sends it.</summary>
|
|
|
|
|
public class Account
|
|
|
|
|
{
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public string Username { get; set; }
|
|
|
|
|
/// <summary>username for a local account, username@host for a remote one.</summary>
|
|
|
|
|
public string Acct { get; set; }
|
|
|
|
|
public string DisplayName { get; set; }
|
|
|
|
|
public bool Locked { get; set; }
|
|
|
|
|
public bool Bot { get; set; }
|
|
|
|
|
public bool Group { get; set; }
|
|
|
|
|
public DateTime? CreatedAt { get; set; }
|
|
|
|
|
public string Note { get; set; }
|
|
|
|
|
public string Url { get; set; }
|
|
|
|
|
public string Uri { get; set; }
|
|
|
|
|
public string Avatar { get; set; }
|
|
|
|
|
public string AvatarStatic { get; set; }
|
|
|
|
|
public string Header { get; set; }
|
|
|
|
|
public string HeaderStatic { get; set; }
|
|
|
|
|
public int FollowersCount { get; set; }
|
|
|
|
|
public int FollowingCount { get; set; }
|
|
|
|
|
public int StatusesCount { get; set; }
|
|
|
|
|
public string LastStatusAt { get; set; }
|
|
|
|
|
public List<CustomEmoji> Emojis { get; set; } = [];
|
|
|
|
|
public List<AccountField> Fields { get; set; } = [];
|
2026-10-05 18:39:56 +02:00
|
|
|
/// <summary>The account it moved to (PrivaPub shows it once the new account names this one among its aliases).</summary>
|
|
|
|
|
public Account Moved { get; set; }
|
2026-10-05 06:20:18 +02:00
|
|
|
/// <summary>Whether it is listed in the directory and suggested; null when its server does not say.</summary>
|
|
|
|
|
public bool? Discoverable { get; set; }
|
|
|
|
|
/// <summary>Whether its public posts may be found by full-text search.</summary>
|
|
|
|
|
public bool? Indexable { get; set; }
|
2026-10-17 05:41:10 +02:00
|
|
|
/// <summary>Silenced by this server's staff, or its server is (Mastodon's `limited`): kept out of public timelines,
|
|
|
|
|
/// trends and search, still read by its followers and by whoever opens it. Null otherwise.</summary>
|
|
|
|
|
public bool? Limited { get; set; }
|
2026-10-05 06:20:18 +02:00
|
|
|
/// <summary>The persona's own account only (verify_credentials, update_credentials): its profile as written and its
|
|
|
|
|
/// posting defaults.</summary>
|
|
|
|
|
public AccountSource Source { get; set; }
|
2026-10-04 11:03:14 +02:00
|
|
|
|
|
|
|
|
/// <summary>The account's server: the host of its ActivityPub id.</summary>
|
|
|
|
|
public string Host => System.Uri.TryCreate(Uri, UriKind.Absolute, out var uri) ? uri.Host.ToLowerInvariant() : default;
|
|
|
|
|
|
|
|
|
|
/// <summary>The name to show: the display name, or the username when there is none.</summary>
|
|
|
|
|
public string Name => string.IsNullOrWhiteSpace(DisplayName) ? Username : DisplayName;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-05 06:20:18 +02:00
|
|
|
public class AccountSource
|
|
|
|
|
{
|
|
|
|
|
/// <summary>The biography as written, before PrivaPub renders it.</summary>
|
|
|
|
|
public string Note { get; set; }
|
|
|
|
|
public List<AccountField> Fields { get; set; } = [];
|
|
|
|
|
/// <summary>The default visibility of a new post: public, unlisted or private.</summary>
|
|
|
|
|
public string Privacy { get; set; }
|
|
|
|
|
public bool Sensitive { get; set; }
|
|
|
|
|
public string Language { get; set; }
|
|
|
|
|
/// <summary>Who may quote the persona's posts: public, followers or nobody.</summary>
|
|
|
|
|
public string QuotePolicy { get; set; }
|
|
|
|
|
public int FollowRequestsCount { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>A page of accounts (mutes, blocks), and the cursor of the next one: null at the end.</summary>
|
|
|
|
|
public class AccountPage
|
|
|
|
|
{
|
|
|
|
|
public List<Account> Accounts { get; set; } = [];
|
|
|
|
|
public string MaxId { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-04 11:03:14 +02:00
|
|
|
public class AccountField
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
public DateTime? VerifiedAt { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-18 08:24:43 +02:00
|
|
|
/// <summary>A custom emoji: one a post or an account names (its server's), or one of this server's own as
|
|
|
|
|
/// /api/v1/custom_emojis lists them for the picker, with its category.</summary>
|
2026-10-04 11:03:14 +02:00
|
|
|
public class CustomEmoji
|
|
|
|
|
{
|
|
|
|
|
public string Shortcode { get; set; }
|
|
|
|
|
public string Url { get; set; }
|
|
|
|
|
public string StaticUrl { get; set; }
|
2026-10-18 08:24:43 +02:00
|
|
|
public bool VisibleInPicker { get; set; }
|
|
|
|
|
public string Category { get; set; }
|
2026-10-04 11:03:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class Relationship
|
|
|
|
|
{
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public bool Following { get; set; }
|
|
|
|
|
public bool FollowedBy { get; set; }
|
|
|
|
|
public bool Blocking { get; set; }
|
2026-10-05 01:23:18 +02:00
|
|
|
public bool BlockedBy { get; set; }
|
2026-10-04 11:03:14 +02:00
|
|
|
public bool Muting { get; set; }
|
2026-10-05 06:20:18 +02:00
|
|
|
public bool MutingNotifications { get; set; }
|
|
|
|
|
public bool ShowingReblogs { get; set; }
|
2026-10-18 08:58:30 +02:00
|
|
|
/// <summary>The persona is told of each of the account's new posts (a `status` notification): the follow's notify.</summary>
|
2026-10-05 06:20:18 +02:00
|
|
|
public bool Notifying { get; set; }
|
2026-10-18 08:58:30 +02:00
|
|
|
/// <summary>The languages of its posts that reach the persona's home feed (primary subtags, as PrivaPub keeps them).
|
|
|
|
|
/// PrivaPub sends null for every language, which the client reads as an empty list does.</summary>
|
|
|
|
|
public List<string> Languages { get; set; } = [];
|
2026-10-04 11:03:14 +02:00
|
|
|
public bool Requested { get; set; }
|
2026-10-05 01:23:18 +02:00
|
|
|
public bool RequestedBy { get; set; }
|
|
|
|
|
public bool DomainBlocking { get; set; }
|
2026-10-18 08:58:30 +02:00
|
|
|
/// <summary>In the persona's recommendations (Mastodon's endorsements): private here, listed to the persona alone and
|
|
|
|
|
/// never federated; only while it follows the account.</summary>
|
|
|
|
|
public bool Endorsed { get; set; }
|
|
|
|
|
/// <summary>The persona's own private note on the account (never its login's, never federated); empty for none.</summary>
|
|
|
|
|
public string Note { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>The languages chosen, none meaning every language.</summary>
|
|
|
|
|
public IReadOnlyList<string> WantedLanguages => Languages ?? [];
|
2026-10-05 01:23:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>/api/v2/search: what matched, a remote handle or URL resolved by PrivaPub.</summary>
|
|
|
|
|
public class SearchResults
|
|
|
|
|
{
|
|
|
|
|
public List<Account> Accounts { get; set; } = [];
|
|
|
|
|
public List<Status> Statuses { get; set; } = [];
|
|
|
|
|
public List<StatusTag> Hashtags { get; set; } = [];
|
2026-10-04 11:03:14 +02:00
|
|
|
}
|