[backend/masto-client] Return profile fields in /accounts/verify_credentials
This commit is contained in:
parent
0414c791e6
commit
ec6a3f5e73
2 changed files with 11 additions and 7 deletions
|
@ -36,6 +36,10 @@ public class UserRenderer(IOptions<Config.InstanceSection> config, MfmConverter
|
|||
.AwaitAllAsync()
|
||||
: null;
|
||||
|
||||
var fieldsSource = source
|
||||
? profile?.Fields.Select(p => new Field { Name = p.Name, Value = p.Value }).ToList() ?? []
|
||||
: [];
|
||||
|
||||
var res = new AccountEntity
|
||||
{
|
||||
Id = user.Id,
|
||||
|
@ -66,7 +70,7 @@ public class UserRenderer(IOptions<Config.InstanceSection> config, MfmConverter
|
|||
//TODO: populate these
|
||||
res.Source = new AccountSource
|
||||
{
|
||||
Fields = [],
|
||||
Fields = fieldsSource,
|
||||
Language = "",
|
||||
Note = profile?.Description ?? "",
|
||||
Privacy = StatusEntity.EncodeVisibility(user.UserSettings?.DefaultNoteVisibility ??
|
||||
|
|
|
@ -42,5 +42,5 @@ public class AccountSource
|
|||
[J("note")] public required string Note { get; set; }
|
||||
[J("privacy")] public required string Privacy { get; set; }
|
||||
[J("sensitive")] public required bool Sensitive { get; set; }
|
||||
[J("fields")] public required Field[] Fields { get; set; }
|
||||
[J("fields")] public required List<Field> Fields { get; set; }
|
||||
}
|
Loading…
Add table
Reference in a new issue