pleroma: add webfinger address and instance
This commit is contained in:
parent
1a3a0c6d4e
commit
5e0feab2b3
1 changed files with 19 additions and 1 deletions
|
@ -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))]
|
||||||
|
|
Loading…
Reference in a new issue