Home timelines, mention notifications, and threads that fetch their parents
Fanout writes a TimelineEntry for every persona a post should reach: the author, local followers of a local author, local followers of a remote one, the members of a direct conversation or a circle. Mastodon's home rules apply when it is written: a reply shows only to followers of both sides (or to the one replied to), a reblog only where reblogs are wanted. A mention of a local persona becomes a Mention notification. Inbound posts are now also kept when a persona follows their author. RemotePosts holds what CreateHandler and backfill share: building a Post from a note, and fetching a public parent the first time a reply to it arrives, so its author is known (a reply to an unknown or non-public parent stays out of home timelines). Each fetched ancestor queues a FetchAncestors job for the next one, up to ten deep. /clientapi/timeline/home and /clientapi/notifications (with /notifications/read) page by max_id for the persona's own root only. 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
a76cc34557
commit
e99b76dbd7
12 files changed
+609
-52
No files matched your search
@@ -6,6 +6,7 @@ using MongoDB.Entities;
|
||||
|
||||
using PrivaPub.Domain.Content;
|
||||
using PrivaPub.Domain.Social;
|
||||
using PrivaPub.Domain.Timelines;
|
||||
using PrivaPub.Federation.Actors;
|
||||
using PrivaPub.Federation.Inbox;
|
||||
using PrivaPub.Federation.Inbox.Handlers;
|
||||
@@ -36,6 +37,8 @@ namespace PrivaPub.Tests.Support
|
||||
Local = new LocalActorService(Db, new StaticOptions<AppConfiguration>(new AppConfiguration { BackendBaseAddress = Base }));
|
||||
Remote = new RemoteActorService(Peer.Http(cache), Local, cache, Db);
|
||||
Delivery = new DeliveryService(Db, Queue);
|
||||
Fanout = new Fanout(Db);
|
||||
RemotePosts = new RemotePosts(Db, Local, Remote, new NoBlocks(), Queue);
|
||||
Receiver = new InboxReceiver(Local, Remote, Queue, new NoBlocks(), NullLogger<InboxReceiver>.Instance);
|
||||
Processor = new InboxProcessor(Remote, new IActivityHandler[]
|
||||
{
|
||||
@@ -43,14 +46,15 @@ namespace PrivaPub.Tests.Support
|
||||
new AcceptHandler(Db, Local),
|
||||
new RejectHandler(Db, Local),
|
||||
new UndoHandler(Db, Local, Remote, Delivery),
|
||||
new CreateHandler(Db, Local, Remote, Delivery, new NoBlocks()),
|
||||
new CreateHandler(Db, Local, Remote, Delivery, new NoBlocks(), Fanout, RemotePosts),
|
||||
new DeleteHandler(Db, Local, Remote, Delivery),
|
||||
new UpdateHandler(Db, Local, Remote)
|
||||
}, NullLogger<InboxProcessor>.Instance);
|
||||
Follows = new FollowService(Db, Local, Remote, Delivery, new KeyLocalizer<GenericRes>(), NullLogger<FollowService>.Instance);
|
||||
Content = new ContentRenderer(Local, Remote);
|
||||
Outbox = new OutboxPublisher(Db, Local, Delivery);
|
||||
Posts = new PostsService(Db, Local, Remote, Delivery, Content, Outbox, new KeyLocalizer<GenericRes>(), NullLogger<PostsService>.Instance);
|
||||
Posts = new PostsService(Db, Local, Remote, Delivery, Content, Outbox, Fanout, new KeyLocalizer<GenericRes>(), NullLogger<PostsService>.Instance);
|
||||
Timelines = new TimelineService(Db, new KeyLocalizer<GenericRes>());
|
||||
}
|
||||
|
||||
public Peer Peer { get; }
|
||||
@@ -65,6 +69,9 @@ namespace PrivaPub.Tests.Support
|
||||
public ContentRenderer Content { get; }
|
||||
public OutboxPublisher Outbox { get; }
|
||||
public PostsService Posts { get; }
|
||||
public Fanout Fanout { get; }
|
||||
public RemotePosts RemotePosts { get; }
|
||||
public TimelineService Timelines { get; }
|
||||
|
||||
public async Task FollowedBy(LocalActor local, RemoteActor follower) =>
|
||||
await DB.Default.SaveAsync(new Follower
|
||||
|
||||
Reference in new issue
Block a user