[backend/masto-client] Remove confusing status context logic

This does technically match Mastodon's behavior, but it doesn't match the behavior of iceshrimp-js, or the Iceshrimp.NET web API. It's also very confusing.
This commit is contained in:
Laura Hausmann 2024-11-20 01:56:41 +01:00
parent 727ba75d0e
commit 862d477dec
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -96,14 +96,6 @@ public class StatusController(
if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.UserHost != null && user == null) if (security.Value.PublicPreview <= Enums.PublicPreview.Restricted && note.UserHost != null && user == null)
throw GracefulException.Forbidden("Public preview is disabled on this instance"); throw GracefulException.Forbidden("Public preview is disabled on this instance");
var shouldShowContext = await db.Notes
.Where(p => p.Id == id)
.FilterHidden(user, db)
.AnyAsync();
if (!shouldShowContext)
return new StatusContext { Ancestors = [], Descendants = [] };
// Akkoma-FE calls /context on boosts // Akkoma-FE calls /context on boosts
if (note.IsPureRenote) if (note.IsPureRenote)
return await GetStatusContext(note.RenoteId!); return await GetStatusContext(note.RenoteId!);