A located post reaches no home, its author's included
The fan-out put every post in its author's home, located ones too, while the Mastodon API looks past located posts everywhere else. In the author's home a located post showed as public (the mapper has no word for it) and every action on it answered 404: decePub's end-to-end runs, which write one from Milano for the globe, found it there. The fan-out now gives a located post no home, no stream and no notification, and the home timeline passes over the entries left from before. A located post is read through /clientapi/post/nearby and deleted through /clientapi/post/delete. NearbyTests checks it has no TimelineEntry; the suite passes (881). 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
5ecf2d9629
commit
6f240828cf
4 files changed
+13
-2
No files matched your search
@@ -43,7 +43,9 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
home.Match(e => !apart.Contains(e.AuthorAccountId));
|
||||
var entries = await Page.From(Params, Limit()).Fetch(home, e => e.PostId, token);
|
||||
var ids = entries.Select(e => e.PostId).ToList();
|
||||
var posts = (await _dbEntities.Posts.Match(p => ids.Contains(p.ID)).Match(VisibilityPolicy.IsShown).ExecuteAsync(token)).ToDictionary(p => p.ID);
|
||||
// (located posts once reached their author's home: the entries left from then are passed over)
|
||||
var posts = (await _dbEntities.Posts.Match(p => ids.Contains(p.ID) && p.Visibility != PostVisibility.LocalGeo).Match(VisibilityPolicy.IsShown)
|
||||
.ExecuteAsync(token)).ToDictionary(p => p.ID);
|
||||
var statuses = await _mapper.Statuses(ids.Where(posts.ContainsKey).Select(id => posts[id]).ToList(), MyId, token);
|
||||
Link("/api/v1/timelines/home", entries.LastOrDefault()?.PostId, entries.FirstOrDefault()?.PostId);
|
||||
return Json(statuses);
|
||||
|
||||
@@ -27,6 +27,11 @@ namespace PrivaPub.Domain.Timelines
|
||||
|
||||
public async Task Distribute(Post post, CancellationToken token)
|
||||
{
|
||||
// a located post is read only through /clientapi/post/nearby: the Mastodon API looks past it everywhere, so in a
|
||||
// home, its author's included, it would be a status nothing can be done to (and it would read as public)
|
||||
if (post.Visibility == PostVisibility.LocalGeo)
|
||||
return;
|
||||
|
||||
var recipients = new HashSet<string>(StringComparer.Ordinal);
|
||||
if (!post.IsFederatedCopy && !string.IsNullOrEmpty(post.GroupUserId))
|
||||
recipients.Add(post.GroupUserId);
|
||||
|
||||
Reference in new issue
Block a user