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; } = [];
|
|
|
|
|
|
|
|
|
|
/// <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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class AccountField
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
public DateTime? VerifiedAt { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class CustomEmoji
|
|
|
|
|
{
|
|
|
|
|
public string Shortcode { get; set; }
|
|
|
|
|
public string Url { get; set; }
|
|
|
|
|
public string StaticUrl { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
public bool Requested { get; set; }
|
2026-10-05 01:23:18 +02:00
|
|
|
public bool RequestedBy { get; set; }
|
|
|
|
|
public bool DomainBlocking { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <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
|
|
|
}
|