A status asked for by id is shown, and remote warnings are their own
GET /api/v1/statuses/:id applied the viewer's own blocks and mutes and answered 200 with null for a post of an author the viewer had blocked; decePub's thread page then showed nothing. As in Mastodon, a status asked for by id (or acted on) is shown whatever the viewer blocked or muted, and only lists leave such posts out; when nothing can be shown the answer is 404, never null, and search leaves it out. A remote post marked sensitive with an empty summary (Akkoma's sensitive media, Lemmy's NSFW) got an invented "Content warning" that hid its words. A remote post now keeps its own summary: sensitive without one hides the media only. A local post warned without words still gets the default warning. Both found by decePub's end-to-end tests on the town. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
d405269526
commit
6b55b5c35c
4 files changed
+48
-7
No files matched your search
@@ -92,7 +92,8 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
public async Task<IActionResult> Get(string id, CancellationToken token)
|
||||
{
|
||||
var post = await Visible(id, token);
|
||||
return post == default ? NotFoundError() : Json(await _mapper.Status(post, MyId, token));
|
||||
var status = post == default ? default : await _mapper.Status(post, MyId, token);
|
||||
return status == default ? NotFoundError() : Json(status);
|
||||
}
|
||||
|
||||
[HttpPut("/api/v1/statuses/{id}"), Scope("write:statuses")]
|
||||
@@ -364,7 +365,8 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
async Task<IActionResult> Unchanged(string id, CancellationToken token)
|
||||
{
|
||||
var post = await Visible(id, token);
|
||||
return post == default ? NotFoundError() : Json(await _mapper.Status(post, MyId, token));
|
||||
var status = post == default ? default : await _mapper.Status(post, MyId, token);
|
||||
return status == default ? NotFoundError() : Json(status);
|
||||
}
|
||||
|
||||
async Task<PostEntity> Visible(string id, CancellationToken token)
|
||||
|
||||
Reference in new issue
Block a user