Changeset 667fb41 in Klonkt for src/routes/posts.js
- Timestamp:
- 07/01/2026 01:32:22 PM (2 months ago)
- Branches:
- main
- Children:
- c45c187
- Parents:
- bb3f67c
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
rbb3f67c r667fb41 580 580 const sent = !!req.query.sent; 581 581 const followed = !!req.query.followed; 582 const voted = !!req.query.voted; 582 583 let target = null, followTarget = null; 583 if (!sent && !followed && uri) {584 if (!sent && !followed && !voted && uri) { 584 585 try { target = await ActivityPubService.resolveRemoteNote(uri); } catch { /* ignore */ } 585 586 // Not a post? Maybe the URI is a profile/actor → offer Follow, not reply. … … 594 595 sent, 595 596 followed, 597 voted: !!req.query.voted, 596 598 liked: !!req.query.liked, 597 599 boosted: !!req.query.boosted, … … 599 601 siteTitle: site ? site.title : '', 600 602 }); 603 }); 604 605 // 📊 Vote on a remote fediverse poll from the interact page (any poll by URL, not just 606 // followed ones). Casts the Mastodon-standard ballot straight to the poll's author. 607 router.post('/authorize_interaction/vote', requireSiteManager, async (req, res) => { 608 const site = res.locals.site; 609 const uri = (req.body.uri || '').toString(); 610 let choice = req.body.choice; 611 if (choice == null) choice = []; 612 if (!Array.isArray(choice)) choice = [choice]; 613 if (site && uri && choice.length) { try { await ActivityPubService.voteOnRemotePoll(site, uri, choice.map(String)); } catch { /* ignore */ } } 614 res.redirect('/authorize_interaction?voted=1&uri=' + encodeURIComponent(uri)); 601 615 }); 602 616
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)