feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready #1

Merged
GKaszewski merged 334 commits from v2 into master 2026-05-16 09:42:43 +00:00
Showing only changes of commit 2a51241bb5 - Show all commits

View File

@@ -48,6 +48,29 @@ impl FederationEventService {
Some(u) => u,
None => return Ok(()),
};
// For replies to remote posts: in_reply_to_url is None but in_reply_to_id
// points to the locally-stored remote thought. Resolve its ap_id so the
// outbound Note includes inReplyTo and Mastodon threads it correctly.
let thought = if thought.in_reply_to_url.is_none() {
if let Some(ref reply_id) = thought.in_reply_to_id {
match self.thoughts.find_by_id(reply_id).await? {
Some(parent) => {
let parent_ap_url = parent.ap_id.unwrap_or_else(|| {
format!("{}/thoughts/{}", self.base_url, reply_id)
});
domain::models::thought::Thought {
in_reply_to_url: Some(parent_ap_url),
..thought
}
}
None => thought,
}
} else {
thought
}
} else {
thought
};
self.ap
.broadcast_create(user_id, &thought, user.username.as_str())
.await