Changeset 6053c6c in Klonkt for src/config/database.js


Ignore:
Timestamp:
07/01/2026 07:38:33 AM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
55a73f0
Parents:
f70e010
Message:

feat(fediverse): show + vote on remote polls (Question) in the News feed

Inbound ActivityPub polls, phase 1. A Question (the Mastodon-standard poll)
from a followed account is now cached and rendered in the News feed with its
options, vote counts and close state, and the owner can vote — a ballot is a
Create(Note) carrying only the chosen option's name + inReplyTo the Question,
addressed to the poll's author (the fediverse-standard vote). The author's
Update(Question) refreshes the authoritative counts; our own vote is preserved.

  • config/database.js — ap_timeline.poll_json column
  • services/ActivityPubService.js — parsePoll(); handle Create/Update(Question); voteOnPoll() sends the ballot + optimistic local tally
  • routes/posts.js — parse poll_json for the feed; POST /news/vote (owner-only)
  • views/pages/news.ejs — poll UI (votable options / result bars) + styles
  • services/i18n.js — poll.vote/votes/closed (nl/en/de)

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    rf70e010 r6053c6c  
    342342  ensureColumn('ap_timeline', 'reblog_handle', 'TEXT');      //   the booster's @handle
    343343  ensureColumn('ap_timeline', 'reblog_icon', 'TEXT');        //   the booster's avatar
     344  ensureColumn('ap_timeline', 'poll_json', 'TEXT');          // a Question (poll): {multiple,options[{name,count}],endTime,closed,voters,voted}
    344345}
    345346
Note: See TracChangeset for help on using the changeset viewer.