Changeset 67fe576 in Klonkt for src/routes/posts.js
- Timestamp:
- 06/25/2026 10:25:57 PM (3 months ago)
- Branches:
- main
- Children:
- 6cabd18
- Parents:
- e91849c
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
re91849c r67fe576 899 899 }); 900 900 901 // Owner likes/boosts a fediverse comment on their own post — directly as the 902 // site, no "your server" detour (mirrors /fedi-reply). 903 router.post('/posts/:slug/fedi-react', requireSiteManager, async (req, res) => { 904 const site = res.locals.site; 905 if (!site) return res.status(404).send('Site required'); 906 const post = db.prepare('SELECT id, slug FROM posts WHERE site_id = ? AND slug = ?').get(site.id, req.params.slug); 907 if (!post) return res.status(404).send('Not found'); 908 const parent = ActivityPubService.getInteractionById(req.body.interaction_id); 909 const kind = req.body.kind === 'boost' ? 'boost' : 'like'; 910 if (parent && parent.post_id === post.id && parent.object_uri) { 911 ActivityPubService.sendInteraction(site, kind, parent.object_uri, parent.actor_uri) 912 .catch((e) => console.warn('[AP] reaction failed:', e.message)); 913 } 914 res.redirect(`${res.locals.siteUrlBase || ''}/${post.slug}#fediverse`); 915 }); 916 901 917 export default router; 902 918 export { postNeighbors };
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)