pleroma: add webfinger address and instance

This commit is contained in:
uwaa 2024-12-18 13:08:27 +00:00
parent 1a3a0c6d4e
commit 5e0feab2b3

View file

@ -41,7 +41,25 @@ public class Account
[JsonPropertyName("username")] [JsonPropertyName("username")]
public string Username { get; set; } = null!; public string Username { get; set; } = null!;
public override string ToString() => $"@{Username}"; [JsonPropertyName("acct")]
public string Webfinger { get; set; } = null!;
public string? Instance
{
get
{
if (Webfinger == null)
return null;
int spl = Webfinger.IndexOf('@');
if (spl == -1)
return null;
return Webfinger[(spl + 1)..];
}
}
public override string ToString() => $"@{Webfinger}";
} }
[JsonConverter(typeof(AccountIDConverter))] [JsonConverter(typeof(AccountIDConverter))]