[backend/masto-client] Don't forbid requesting relationship status with yourself
Some Mastodon clients rely on this (for some reason)
This commit is contained in:
parent
f30e7f4ac3
commit
c1650da632
1 changed files with 1 additions and 4 deletions
|
@ -171,7 +171,7 @@ public class AccountController(
|
||||||
followee.FollowersCount -= followings.Count;
|
followee.FollowersCount -= followings.Count;
|
||||||
db.RemoveRange(followings);
|
db.RemoveRange(followings);
|
||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
|
|
||||||
followee.PrecomputedIsFollowedBy = false;
|
followee.PrecomputedIsFollowedBy = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,9 +208,6 @@ public class AccountController(
|
||||||
public async Task<IActionResult> GetRelationships([FromQuery(Name = "id")] List<string> ids) {
|
public async Task<IActionResult> GetRelationships([FromQuery(Name = "id")] List<string> ids) {
|
||||||
var user = HttpContext.GetUserOrFail();
|
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()
|
var users = await db.Users.IncludeCommonProperties()
|
||||||
.Where(p => ids.Contains(p.Id))
|
.Where(p => ids.Contains(p.Id))
|
||||||
.PrecomputeRelationshipData(user)
|
.PrecomputeRelationshipData(user)
|
||||||
|
|
Loading…
Add table
Reference in a new issue