a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/masto-client] AccountUpdateRequest.fields_attributes Mastodon compatibility (ISH-868)

Kopper c676eb7f 66c3ffb5

+13 -2
+4 -1
Iceshrimp.Backend/Controllers/Mastodon/AccountController.cs
··· 86 86 if (request.PermitFollowback.HasValue) 87 87 user.UserSettings.AutoAcceptFollowed = request.PermitFollowback.Value; 88 88 89 - if (request.Fields?.Where(p => p is { Name: not null, Value: not null }).ToList() is { Count: > 0 } fields) 89 + var requestFields = request.JsonFields?.Values as IEnumerable<AccountSchemas.AccountUpdateField> 90 + ?? request.Fields; 91 + 92 + if (requestFields?.Where(p => p is { Name: not null, Value: not null }).ToList() is { Count: > 0 } fields) 90 93 { 91 94 user.UserProfile.Fields = 92 95 fields.Select(p => new UserProfile.Field
+9 -1
Iceshrimp.Backend/Controllers/Mastodon/Schemas/AccountSchemas.cs
··· 1 1 using Microsoft.AspNetCore.Mvc; 2 + using Microsoft.AspNetCore.Mvc.ModelBinding; 2 3 using B = Microsoft.AspNetCore.Mvc.BindPropertyAttribute; 3 4 using J = System.Text.Json.Serialization.JsonPropertyNameAttribute; 5 + using JI = System.Text.Json.Serialization.JsonIgnoreAttribute; 4 6 5 7 namespace Iceshrimp.Backend.Controllers.Mastodon.Schemas; 6 8 ··· 37 39 [B(Name = "indexable")] 38 40 public bool? IsIndexable { get; set; } 39 41 40 - [J("fields_attributes")] 41 42 [B(Name = "fields_attributes")] 43 + [JI] 42 44 public List<AccountUpdateField>? Fields { get; set; } 45 + 46 + /// Note that the integer index does not actually matter -- fields will be populated by the order in which they are provided. 47 + /// https://github.com/mastodon/mastodon/issues/22174 48 + [J("fields_attributes")] 49 + [BindNever] 50 + public OrderedDictionary<string, AccountUpdateField>? JsonFields { get; set; } 43 51 44 52 [J("permit_followback")] 45 53 [B(Name = "permit_followback")]