Ignore:
Timestamp:
06/25/2026 05:20:29 AM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
e951b7c
Parents:
5a6a457
Message:

feat(fediverse): NodeInfo 2.1 + per-note replies collection

NodeInfo (/.well-known/nodeinfo + /nodeinfo/2.1) so fediverse tools recognise the
instance (software 'klonkt', user/post counts). Notes now carry a 'replies'
OrderedCollection (/ap/notes/:id/replies) listing inbound + our own reply note
URIs, so remote servers can fetch the whole thread.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    r5a6a457 rd7526bd  
    153153    cc: [`${aId}/followers`],
    154154    tag: Array.isArray(post.tags) ? post.tags.map((t) => ({ type: 'Hashtag', name: '#' + String(t).replace(/\s+/g, '') })) : [],
     155    replies: `${id}/replies`,
    155156  };
    156157  if (attachment.length) note.attachment = attachment;
    157158  return note;
     159}
     160
     161// All reply note URIs on a local post (inbound fediverse replies + our own
     162// outbound replies) — backs the Note's `replies` Collection so remote servers
     163// can fetch the whole thread.
     164export function getReplyUris(base, postId) {
     165  const out = [];
     166  try {
     167    for (const r of db.prepare("SELECT object_uri FROM ap_interactions WHERE kind = 'reply' AND post_id = ? AND object_uri != '' ORDER BY created_at").all(postId)) out.push(r.object_uri);
     168    for (const r of db.prepare('SELECT id FROM ap_outbox WHERE post_id = ? ORDER BY rowid').all(postId)) out.push(`${base}/ap/notes/${r.id}`);
     169  } catch { /* non-fatal */ }
     170  return out;
    158171}
    159172
     
    906919  getNotifications, listBlocks, isBlockedAny, blockTarget, unblock,
    907920  deliverWithRetry, enqueueDelivery, processDeliveryQueue, startDeliveryWorker,
     921  getReplyUris,
    908922};
Note: See TracChangeset for help on using the changeset viewer.