diff --git a/Iceshrimp.Backend/Controllers/Mastodon/InstanceController.cs b/Iceshrimp.Backend/Controllers/Mastodon/InstanceController.cs index 73662bf8..05e8105f 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/InstanceController.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/InstanceController.cs @@ -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 instance, - // ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local - IOptionsSnapshot 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> 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)] diff --git a/Iceshrimp.Backend/Controllers/Mastodon/Renderers/UserRenderer.cs b/Iceshrimp.Backend/Controllers/Mastodon/Renderers/UserRenderer.cs index b793465d..116b8e69 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/Renderers/UserRenderer.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/Renderers/UserRenderer.cs @@ -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 diff --git a/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/AccountEntity.cs b/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/AccountEntity.cs index 576fa109..80d47a48 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/AccountEntity.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/Schemas/Entities/AccountEntity.cs @@ -29,6 +29,7 @@ public class AccountEntity : IIdentifiable [J("emojis")] public required List 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; }