Changeset ffa53cc in Klonkt
- Timestamp:
- 06/24/2026 01:56:06 PM (3 months ago)
- Branches:
- main
- Children:
- c73ac64
- Parents:
- de3d24b
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rde3d24b rffa53cc 386 386 const actorUri = typeof act.actor === 'string' ? act.actor : (act.actor && act.actor.id); 387 387 const resolveActor = async (uri) => ((verified && verified.id === uri) ? verified : await fetchActor(uri).catch(() => null)); 388 // Activities from our OWN actors are already stored via ap_outbox — don't re-store. 389 const isLocalActor = !!(base && actorUri && actorUri.startsWith(`${base}/ap/users/`)); 388 390 389 391 // Inbound reply: a Create whose object replies to one of our notes (post OR comment). … … 391 393 const o = act.object; 392 394 const tgt = findThreadTarget(o.inReplyTo, base); 393 if (tgt && actorUri ) {395 if (tgt && actorUri && !isLocalActor) { 394 396 const ai = actorInfo(await resolveActor(actorUri), actorUri); 395 397 const html = HtmlSanitizerService.sanitize(o.content || ''); … … 402 404 const tgt = act.object; 403 405 const pid = postIdFromNoteUrl(typeof tgt === 'string' ? tgt : (tgt && tgt.id), base); 404 if (pid && actorUri && localPostExists(pid)) {406 if (pid && actorUri && !isLocalActor && localPostExists(pid)) { 405 407 const ai = actorInfo(await resolveActor(actorUri), actorUri); 406 408 iStmts().ins.run(type.toLowerCase(), pid, '', actorUri, ai.name, ai.handle, ai.url, ai.icon, null, null, null); … … 518 520 if (parent.threadInbox) inboxes.add(parent.threadInbox); // post author's server (nesting) 519 521 for (const f of fStmts().list.all(site.slug)) inboxes.add(f.shared_inbox || f.inbox); 522 inboxes.delete(`${me}/inbox`); // never deliver to ourselves (already in ap_outbox) 523 inboxes.delete(`${base}/ap/inbox`); // (our own shared inbox) → avoids a self-duplicate 520 524 let delivered = 0; 521 525 for (const inbox of [...inboxes].filter(Boolean)) {
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)