Changeset 279ca0b in Klonkt for src/routes/posts.js
- Timestamp:
- 08/06/2026 12:42:50 PM (5 weeks ago)
- Branches:
- main
- Children:
- 32a4ffb
- Parents:
- bedd7a6
- git-author:
- Robin <roboburr@…> (08/06/2026 12:42:40 PM)
- git-committer:
- roboburr <roboburr@…> (08/06/2026 12:42:50 PM)
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
rbedd7a6 r279ca0b 1557 1557 const kind = req.body.kind === 'boost' ? 'boost' : 'like'; 1558 1558 if (parent && parent.post_id === post.id && parent.object_uri) { 1559 if (kind === 'boost') { 1560 // Toggle: boost an unboosted comment, or retract it (Undo Announce) if already boosted. 1561 const on = !parent.acted_boost; 1562 ActivityPubService.sendInteraction(site, on ? 'boost' : 'unboost', parent.object_uri, parent.actor_uri) 1563 .catch((e) => console.warn('[AP] reaction failed:', e.message)); 1564 ActivityPubService.setInteractionBoosted(parent.id, on); 1565 } else { 1566 // Toggle: like an unliked comment, or un-favourite (Undo Like) if already liked. 1567 const on = !parent.acted_like; 1568 ActivityPubService.sendInteraction(site, on ? 'like' : 'unlike', parent.object_uri, parent.actor_uri) 1569 .catch((e) => console.warn('[AP] reaction failed:', e.message)); 1570 ActivityPubService.setInteractionLiked(parent.id, on); 1571 } 1559 // Toggle: react, or retract it (Undo Announce / Undo Like) if already on. 1560 // De stand komt uit dezelfde bron als de knop die je zag; leest de toggle uit 1561 // de kolom en de knop uit de tussentabel, dan draait een divergentie de 1562 // richting om en stuur je een Undo voor iets dat nooit is verstuurd. 1563 const ik = ActivityPubService.getReaction(site.slug, parent.object_uri); 1564 const on = kind === 'boost' ? !ik.boosted : !ik.liked; 1565 ActivityPubService.sendInteraction(site, on ? kind : `un${kind}`, parent.object_uri, parent.actor_uri) 1566 .catch((e) => console.warn('[AP] reaction failed:', e.message)); 1567 // De tussentabel is de waarheid (shaer-ipb), gesleuteld op object_uri -- net 1568 // als de Like die hierboven de fediverse in gaat. acted_* blijft voorlopig 1569 // als afgeleide meelopen, hetzelfde vangnet dat ap_timeline.liked na 1570 // shaer-9e9 is: pas weghalen als deze migratie een release heeft ingelopen. 1571 ActivityPubService.setReaction(site.slug, parent.object_uri, kind, on); 1572 if (kind === 'boost') ActivityPubService.setInteractionBoosted(parent.id, on); 1573 else ActivityPubService.setInteractionLiked(parent.id, on); 1572 1574 } 1573 1575 res.redirect(`${res.locals.siteUrlBase || ''}/${post.slug}#fediverse`);
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)