Initial poll implementation - #2113
Open
BentiGorlich wants to merge 8 commits into
Open
BentiGorlich wants to merge 8 commits into
BentiGorlich wants to merge 8 commits into
Conversation
Member
Author
|
Open things:
|
BentiGorlich
force-pushed
the
new/polls
branch
2 times, most recently
from
May 5, 2026 14:17
ca5a66c to
21b69c7
Compare
- add the ability to add a poll to Entry, EntryComment, Post and PostComment - Polls: - can be multiple choice - can contain an unlimited number of choices - can expire - Add a hidden form for the poll to all create forms, the form appears when a checkbox is checked - The ActivityPub implementation is the same as on Mastodon: https://docs.joinmastodon.org/spec/activitypub/#Question - Add tests for the ActivityPub implementation and the Api controller - The api had to be shifted a bit -> the `serialize...` functions in the base api take only the entity classes now instead of their dto variant -> touched a lot of api classes because of this
- fix the end date being ignored upon poll creation - make the poll end date DATETIMETZ_IMMUTABLE -> with time zone - implement refreshing the vote counts of remote polls - fix handling of `Update` activities -> only edit the poll (and discarding all votes) when the content actually changed, pass through the correct object to refresh the poll counts - send an `Update` activity when a vote is created on a local poll - fix missing query from `EntryCommentRepository` and `PostCommentRepository` in the `PollVoteFactory` - add a way to invalidate the cache of an activity object - add support for the `closed` property on polls (it is the same as `endTime`) - add a way to just show the results of a poll in the UI
- if an object contains a poll, it needs to be of type 'Question' in the AP representation - update the testing snapshots - scrub the URL from `Question` object snapshots as well
BentiGorlich
force-pushed
the
new/polls
branch
from
September 21, 2026 10:45
94fdbef to
d227f4e
Compare
Member
Author
|
As I implemented all the remaining things a while back and now tested it on my server in combination with mastodon, I think this is ready |
BentiGorlich
marked this pull request as ready for review
September 21, 2026 10:56
melroy89
reviewed
Sep 21, 2026
melroy89
reviewed
Sep 21, 2026
- fix duplicate choices not being noticed - fix endDate not being assigned in the EntryFactory - fix choices not being part of the poll after being created - add tests for that
# Conflicts: # translations/messages.en.yaml
Member
|
Just some small minor remarks;
|
- append the choice array of the poll, rather than refreshing the entity - move the test to the functional directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
serialize...functions in the base api take only the entity classes now instead of their dto variant -> touched a lot of api classes because of thisImages:
Each create form (Thread, Microblog, Comments) now have this checkbox to add a poll:

When checked it looks like this:

Once created it looks like this:

If you have voted it looks like this:

Closes #647