idk what changed here
Some checks are pending
/ test-build-and-push (push) Waiting to run

This commit is contained in:
notfire 2025-03-30 17:53:53 -04:00
parent 8bb1ead80e
commit 7122a89fb4
Signed by: notfire
GPG key ID: 3AFDACAAB4E56B16
3 changed files with 3 additions and 17 deletions

View file

@ -7,9 +7,7 @@ using Iceshrimp.Backend.Controllers.Pleroma.Schemas.Entities;
using Iceshrimp.Backend.Controllers.Shared.Attributes;
using Iceshrimp.Backend.Core.Configuration;
using Iceshrimp.Backend.Core.Database;
using Iceshrimp.Backend.Core.Database.Tables;
using Iceshrimp.Backend.Core.Extensions;
using Iceshrimp.Backend.Core.Middleware;
using Iceshrimp.Backend.Core.Services;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
@ -25,8 +23,6 @@ namespace Iceshrimp.Backend.Controllers.Mastodon;
[Produces(MediaTypeNames.Application.Json)]
public class InstanceController(
IOptions<Config.InstanceSection> instance,
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local
IOptionsSnapshot<Config.SecuritySection> security,
DatabaseContext db,
MetaService meta
) : ControllerBase
@ -103,18 +99,6 @@ public class InstanceController(
.Select(p => new RuleEntity { Id = p.Id, Text = p.Text, Hint = p.Description })
.ToListAsync();
}
[HttpGet("/api/v1/domain_blocks")]
[ProducesResults(HttpStatusCode.OK)]
public async Task<List<BlockedInstance>> GetBlockedInstances()
{
if (security.Value.FederationMode == Enums.FederationMode.AllowList)
throw GracefulException.BadRequest("Federation mode is set to allowlist.");
var q = db.BlockedInstances.OrderBy(p => p.Host).AsQueryable();
return await q.ToListAsync();
}
[HttpGet("/api/v1/instance/translation_languages")]
[ProducesResults(HttpStatusCode.OK)]

View file

@ -74,7 +74,8 @@ public class UserRenderer(
IsBot = user.IsBot,
IsDiscoverable = user.IsExplorable,
Fields = fields?.ToList() ?? [],
Emoji = profileEmoji
Emoji = profileEmoji,
Role = user.IsAdmin ? "admin" : user.IsModerator ? "moderator" : null
};
if (localUser is null && security.Value.PublicPreview == Enums.PublicPreview.RestrictedNoMedia) //TODO

View file

@ -29,6 +29,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("role")] public string? Role { get; set; }
[J("avatar_description")] public required string AvatarDescription { get; set; }
[J("header_description")] public required string HeaderDescription { get; set; }