pleroma: fix Account.Instance (broken in update)

This commit is contained in:
uwaa 2025-02-04 16:27:20 +00:00
parent 1cbf89632c
commit 52a7eb950b

View file

@ -35,23 +35,7 @@ public class Account : ASObject
[JsonPropertyName("username")]
public string Username { get; set; } = null!;
[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 string? Instance => Uri.TryCreate(URL, UriKind.Absolute, out Uri? uri) ? uri.Host : null;
/// <summary>
/// If true, the user opts-out of automated interactions. Bots must not follow these users, nor reply, favorite, boost, or store posts from these users.
@ -63,7 +47,7 @@ public class Account : ASObject
{
}
public override string ToString() => $"@{Webfinger}";
public override string ToString() => $"@{Username}@{Instance}";
}
[JsonConverter(typeof(AccountIDConverter))]