let's try what random github user said
Some checks are pending
/ test-build-and-push (push) Waiting to run
Some checks are pending
/ test-build-and-push (push) Waiting to run
This commit is contained in:
parent
9d174f8ef4
commit
d7c965319d
3 changed files with 12 additions and 3 deletions
|
@ -15,7 +15,8 @@ public class UserRenderer(
|
|||
IOptions<Config.InstanceSection> config,
|
||||
IOptionsSnapshot<Config.SecuritySection> security,
|
||||
MfmConverter mfmConverter,
|
||||
DatabaseContext db
|
||||
DatabaseContext db,
|
||||
FlagService flags
|
||||
) : IScopedService
|
||||
{
|
||||
private readonly string _transparent = $"https://{config.Value.WebDomain}/assets/transparent.png";
|
||||
|
@ -76,7 +77,13 @@ public class UserRenderer(
|
|||
IsBot = user.IsBot,
|
||||
IsDiscoverable = user.IsExplorable,
|
||||
Fields = fields?.ToList() ?? [],
|
||||
Emoji = profileEmoji
|
||||
Emoji = profileEmoji,
|
||||
Pleroma = flags?.IsPleroma.Value == true
|
||||
? new PleromaUserExtensions
|
||||
{
|
||||
IsAdmin = user.IsAdmin,
|
||||
IsModerator = user.IsModerator
|
||||
} : null
|
||||
};
|
||||
|
||||
if (localUser is null && security.Value.PublicPreview == Enums.PublicPreview.RestrictedNoMedia) //TODO
|
||||
|
|
|
@ -30,7 +30,7 @@ public class AccountEntity : IIdentifiable
|
|||
[J("emojis")] public required List<EmojiEntity> Emoji { get; set; }
|
||||
[J("id")] public required string Id { get; set; }
|
||||
[J("last_status_at")] public string? LastStatusAt { get; set; }
|
||||
//[J("pleroma")] public required PleromaUserExtensions? Pleroma { get; set; }
|
||||
[J("pleroma")] public required PleromaUserExtensions? Pleroma { get; set; }
|
||||
|
||||
[J("avatar_description")] public required string AvatarDescription { get; set; }
|
||||
[J("header_description")] public required string HeaderDescription { get; set; }
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using J = System.Text.Json.Serialization.JsonPropertyNameAttribute;
|
||||
|
||||
namespace Iceshrimp.Backend.Controllers.Pleroma.Schemas.Entities;
|
||||
|
||||
[Keyless]
|
||||
public class PleromaUserExtensions
|
||||
{
|
||||
[J("is_admin")] public required bool IsAdmin { get; set; }
|
||||
|
|
Loading…
Add table
Reference in a new issue