From c1650da63288734eb02b646fd18b7a85602c2672 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 12 Feb 2024 03:18:01 +0100 Subject: [PATCH] [backend/masto-client] Don't forbid requesting relationship status with yourself Some Mastodon clients rely on this (for some reason) --- Iceshrimp.Backend/Controllers/Mastodon/AccountController.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Iceshrimp.Backend/Controllers/Mastodon/AccountController.cs b/Iceshrimp.Backend/Controllers/Mastodon/AccountController.cs index b2589ad3..faf4ae63 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/AccountController.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/AccountController.cs @@ -171,7 +171,7 @@ public class AccountController( followee.FollowersCount -= followings.Count; db.RemoveRange(followings); await db.SaveChangesAsync(); - + followee.PrecomputedIsFollowedBy = false; } @@ -208,9 +208,6 @@ public class AccountController( public async Task GetRelationships([FromQuery(Name = "id")] List ids) { var user = HttpContext.GetUserOrFail(); - if (ids.Contains(user.Id)) - throw GracefulException.BadRequest("You cannot request relationship status with yourself"); - var users = await db.Users.IncludeCommonProperties() .Where(p => ids.Contains(p.Id)) .PrecomputeRelationshipData(user)