Changeset f9b1c5c in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 07/30/2026 12:28:25 PM (6 weeks ago)
- Branches:
- main
- Children:
- 6a99668
- Parents:
- 1f640ff
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r1f640ff rf9b1c5c 2321 2321 const parent = await resolveRemoteNote(c2sIdOf(object.inReplyTo)).catch(() => null); 2322 2322 if (!parent) return { status: 502, error: 'cannot_resolve_inReplyTo' }; 2323 // The attachments ride along (Robins melding, 30-7: "502 2324 // reply_failed" op een reply met een foto): deliverReply validates 2325 // them itself (own /media only, image|audio|video, max 4) and a 2326 // media-only reply is a valid reply there. Dropping them here made 2327 // a photo reply arrive naked, and a photo-ONLY reply fail outright. 2328 const atts = (Array.isArray(object.attachment) ? object.attachment : []) 2329 .map((a) => a && typeof a === 'object' ? { 2330 url: String(a.url || '').replace(new RegExp('^' + base.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')), ''), 2331 mediaType: String(a.mediaType || ''), 2332 name: String(a.name || '').slice(0, 120), 2333 } : null) 2334 .filter(Boolean); 2323 2335 // Honour the client's visibility for the reply: 'friends' (followers- 2324 2336 // only, the Shaer detail-view Reply) drops Public; anything else stays 2325 2337 // quiet-public. 'direct' was already handled above. 2326 const r = await deliverReply(site, { postId: parent.localPostId || '', postSlug: null, parent, text: plain, visibility: c2sVisibility(object) }); 2338 const r = await deliverReply(site, { 2339 postId: parent.localPostId || '', postSlug: null, parent, text: plain, 2340 html: object.content || null, attachments: atts, 2341 language: object.language || null, visibility: c2sVisibility(object), 2342 }); 2327 2343 if (!r || !r.id) return { status: 502, error: 'reply_failed' }; 2328 2344 return { status: 201, id: r.id, url: `${base}/ap/notes/${r.id}` };
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)