Changeset 78b6d8a in Klonkt for src/routes/posts.js


Ignore:
Timestamp:
06/26/2026 12:16:33 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
4c47eff
Parents:
3384e95
Message:

feat(tijdlijn): unboost button — retract a boost (Undo Announce) from posts

The 🔁 on a timeline post is now a toggle: not boosted -> boost (Announce + mark
locally); boosted -> unboost (highlighted) which sends Undo(Announce) so followers'
servers remove the reblog, and clears the local flag. sendInteraction handles
'unboost' (Undo wrapping Announce, matched on actor+object — no record of the
original Announce needed). All operator-driven: your click sends it, nothing
automatic touches the fediverse.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/posts.js

    r3384e95 r78b6d8a  
    633633  }
    634634  res.redirect('/tijdlijn?success=' + encodeURIComponent('Geboost 🔁'));
     635});
     636
     637// Unboost (retract): send Undo(Announce) + clear the local flag.
     638router.post('/tijdlijn/unboost', requireSiteManager, async (req, res) => {
     639  const site = res.locals.site;
     640  const note = (req.body.note || '').toString();
     641  if (site && note) {
     642    try { await ActivityPubService.sendInteraction(site, 'unboost', note, (req.body.author || '').toString()); } catch (e) { /* ignore */ }
     643    ActivityPubService.unmarkBoosted(site.slug, note);
     644  }
     645  res.redirect('/tijdlijn?success=' + encodeURIComponent('Boost ingetrokken'));
    635646});
    636647
Note: See TracChangeset for help on using the changeset viewer.