diff --git a/Pleroma/Models/Account.cs b/Pleroma/Models/Account.cs index 8c788ee..63886e2 100644 --- a/Pleroma/Models/Account.cs +++ b/Pleroma/Models/Account.cs @@ -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; /// /// 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))]