Changeset 55bc7f9 in Klonkt for src/routes/activitypub.js


Ignore:
Timestamp:
06/24/2026 12:09:08 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
3a2c9d3
Parents:
47a0d29
Message:

feat(activitypub): reply back to the fediverse (Phase 4 outbound)

Site owner can reply to an inbound fediverse interaction from the post page. The
reply is sent as a signed Create(Note) with inReplyTo + @Mention to the remote
actor's inbox + our followers, stored in ap_outbox, shown in the thread, and
resolvable at /ap/notes/<id>.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/activitypub.js

    r47a0d29 r55bc7f9  
    7474    "SELECT * FROM posts WHERE id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)"
    7575  ).get(req.params.id);
    76   if (!post) return res.status(404).end();
     76  if (!post) {
     77    // Could be one of OUR outbound replies (ap_outbox), not a post.
     78    const note = AP.getOutboxNote(baseUrl(req), req.params.id);
     79    if (note) return AP.sendAP(res, { '@context': 'https://www.w3.org/ns/activitystreams', ...note });
     80    return res.status(404).end();
     81  }
    7782  const site = db.prepare('SELECT * FROM sites WHERE id = ?').get(post.site_id);
    7883  if (!site) return res.status(404).end();
Note: See TracChangeset for help on using the changeset viewer.