Changeset 6053c6c in Klonkt for src/routes/posts.js
- Timestamp:
- 07/01/2026 07:38:33 AM (2 months ago)
- Branches:
- main
- Children:
- 55a73f0
- Parents:
- f70e010
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
rf70e010 r6053c6c 713 713 // top-level "open the player" link that works even when a browser shield/CSP blocks 714 714 // the cross-site iframe (a full-page navigation is not a cross-site frame). 715 return { ...p, content, embedHtml, embedUrl }; 715 let poll = null; 716 if (p.poll_json) { try { poll = JSON.parse(p.poll_json); } catch { /* ignore */ } } 717 return { ...p, content, embedHtml, embedUrl, poll }; 716 718 }); 717 719 // Option A: allow the followed Klonkt sites' player iframes (you follow them) by … … 799 801 } 800 802 if (req.get('X-Requested-With') === 'fetch') return res.json({ ok: true, on }); 803 res.redirect('/news'); 804 }); 805 806 // Vote on a fediverse poll (a Question in the feed). Owner-only, like the other interactions. 807 router.post('/news/vote', requireSiteManager, async (req, res) => { 808 const site = res.locals.site; 809 const note = (req.body.note || '').toString(); 810 let choice = req.body.choice; 811 if (choice == null) choice = []; 812 if (!Array.isArray(choice)) choice = [choice]; 813 if (site && note && choice.length) { try { await ActivityPubService.voteOnPoll(site, note, choice.map(String)); } catch (e) { /* ignore */ } } 801 814 res.redirect('/news'); 802 815 });
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)