pleroma: fix Account.Instance (broken in update)
This commit is contained in:
parent
1cbf89632c
commit
52a7eb950b
1 changed files with 2 additions and 18 deletions
|
@ -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))]
|
||||
|
|
Loading…
Reference in a new issue