Blocks, mutes, bookmarks, pins and reports
- Blocks are per persona and never federate (a Block activity would tell
the other server who blocked whom): the blocked account is removed as a
follower, with a Reject{Follow} if it is remote, unfollowed, cleared from
home and notifications, and refused with Reject if it follows again.
- Mutes (optionally timed, optionally sparing notifications) and per-
persona domain blocks keep authors out of home timelines, notifications
and every status list the API returns; the boosts of a hidden author's
posts are hidden too.
- Bookmarks and pins (at most five, public or unlisted, own posts) with
their Mastodon endpoints and flags; pinned posts are the actor's
`featured` collection at /trophies, and `featuredTags` points at
/tattoos.
- Reports: /api/v1/reports stores the report and, when forwarding to a
remote account, sends Flag from the instance actor, so the reporting
persona is never named to the other server. An inbound Flag about a local
persona or its posts becomes a report; moderators list and resolve them
under /clientapi/moderator/reports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
1 parent
525b5368a1
commit
8f75317050
20 files changed
+813
-21
No files matched your search
@@ -0,0 +1,42 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using PrivaPub.Api.Mastodon.Infrastructure;
|
||||
using PrivaPub.Api.Mastodon.Mappers;
|
||||
using PrivaPub.Domain.Relationships;
|
||||
|
||||
namespace PrivaPub.Api.Mastodon.Controllers
|
||||
{
|
||||
public class ReportsController : MastodonController
|
||||
{
|
||||
readonly IReportService _reports;
|
||||
readonly MastodonMapper _mapper;
|
||||
|
||||
public ReportsController(IReportService reports, MastodonMapper mapper)
|
||||
{
|
||||
_reports = reports;
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
[HttpPost("/api/v1/reports"), Scope("write:reports")]
|
||||
public async Task<IActionResult> Create(CancellationToken token)
|
||||
{
|
||||
var report = await _reports.File(Me, Params.Get("account_id"), Params.List("status_ids"), Params.Get("comment"), Params.Get("category"),
|
||||
Params.Bool("forward") == true, token);
|
||||
if (report == default)
|
||||
return NotFoundError();
|
||||
return Json(new
|
||||
{
|
||||
id = report.ID,
|
||||
action_taken = false,
|
||||
action_taken_at = default(string),
|
||||
category = report.Category,
|
||||
comment = report.Comment ?? string.Empty,
|
||||
forwarded = report.Forwarded,
|
||||
created_at = MastodonJson.Time(report.CreatedAt),
|
||||
status_ids = report.PostIds,
|
||||
rule_ids = Array.Empty<string>(),
|
||||
target_account = await _mapper.Account(report.TargetAccountId, token)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user