Changeset b6cdc3d in Klonkt for src/routes


Ignore:
Timestamp:
06/26/2026 01:13:21 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
54d2f98
Parents:
c7c7f02
Message:

feat(fedi): like/boost/reply on the interaction page + display-only stats

  • Post 'From the fediverse' stats (like/boost/reply) are now display-only counters (the star is no longer a button). One CTA, renamed 'Interact via the fediverse'.
  • The /authorize_interaction page now offers Like AND Boost (next to reply), via a new POST /authorize_interaction/boost (Undo-able later; markBoosted so it shows in the Cirkel if it's in your timeline).
  • The 'view the full post + replies on the source' link is now a prominent button.
  • i18n nl/en/de: fedi.boost_btn, fedi.boosted_title/_done, fedi.remote_interact.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/posts.js

    rc7c7f02 rb6cdc3d  
    501501    followed,
    502502    liked: !!req.query.liked,
     503    boosted: !!req.query.boosted,
    503504    siteTitle: site ? site.title : '',
    504505  });
     
    515516  }
    516517  res.redirect('/authorize_interaction?liked=1&uri=' + encodeURIComponent(uri));
     518});
     519
     520// 🔁 Boost a remote post from your own site. Also flags it for the Cirkel
     521// (markBoosted is a no-op if the post isn't in your timeline).
     522router.post('/authorize_interaction/boost', requireSiteManager, (req, res) => {
     523  const site = res.locals.site;
     524  const uri = (req.body.uri || '').toString();
     525  if (site && uri) {
     526    ActivityPubService.resolveRemoteNote(uri)
     527      .then((note) => {
     528        if (!note) return;
     529        const id = note.object_uri || uri;
     530        return Promise.resolve(ActivityPubService.sendInteraction(site, 'boost', id, note.actor_uri))
     531          .then(() => ActivityPubService.markBoosted(site.slug, id));
     532      })
     533      .catch((e) => console.warn('[AP] remote boost failed:', e.message));
     534  }
     535  res.redirect('/authorize_interaction?boosted=1&uri=' + encodeURIComponent(uri));
    517536});
    518537
Note: See TracChangeset for help on using the changeset viewer.