mirror of
https://codeberg.org/fediverse/fep.git
synced 2026-08-09 05:56:10 +00:00
FEP-9967: Update proposal (#842)
- Added "Counting voters" section explaining the purpose of `votersCount` property. - Added "Limits" section with Mastodon's poll option limit. - Removed `MUST` requirement from the description of anonymous poll. - Added "Closing a poll" section. - Added link to `Question` JSON schema. Reviewed-on: https://codeberg.org/fediverse/fep/pulls/842
This commit is contained in:
+21
-3
@@ -59,8 +59,6 @@ The value of this property MUST be an array of objects representing poll options
|
||||
|
||||
The `name` of a poll option MUST be unique within a poll. If the text contains [custom emoji][FEP-9098] microsyntax, the corresponding `Emoji` objects are added to the `tag` array of the `Question` object.
|
||||
|
||||
The number of poll options is often limited, but the limit differs between implementations.
|
||||
|
||||
`Question` objects MAY have an `endTime` property indicating the time when the poll ends. Some implementations use `closed` property instead of `endTime` or in addition to it (even if the poll is open). Consumers MUST process `closed` in the same way as `endTime`.
|
||||
|
||||
`Question` objects SHOULD have an `updated` property.
|
||||
@@ -98,6 +96,18 @@ Example:
|
||||
}
|
||||
```
|
||||
|
||||
### Counting voters
|
||||
|
||||
The [`votersCount`](https://docs.joinmastodon.org/spec/activitypub/#poll-specific-properties) property can be used to specify how many people have voted in a poll.
|
||||
|
||||
This number will be distinct from the number of votes in case of multiple-choice polls, and can be used to calculate the proportion of participants who voted for a poll option.
|
||||
|
||||
### Limits
|
||||
|
||||
The number of poll options is often limited, but the limit differs between implementations.
|
||||
|
||||
Mastodon allows up to [500 options](https://github.com/mastodon/mastodon/blob/v4.5.9/FEDERATION.md#size-limits) per poll.
|
||||
|
||||
## Voting
|
||||
|
||||
### Vote object
|
||||
@@ -113,7 +123,7 @@ A vote is represented by a `Note` object with the following structure:
|
||||
|
||||
The object MUST NOT have a `content` property.
|
||||
|
||||
This object is wrapped in a `Create` activity and sent to the author of the poll. If the poll is anonymous, this activity MUST NOT be delivered to anyone else.
|
||||
This object is wrapped in a `Create` activity and sent to the author of the poll. If the poll is anonymous, this activity is not delivered to anyone else.
|
||||
|
||||
When a poll allows multiple choices, each vote MUST be sent as a separate activity.
|
||||
|
||||
@@ -150,6 +160,10 @@ Otherwise, the author of the poll updates the vote count for the specified poll
|
||||
|
||||
When actor that published a poll receives a vote, it publishes an `Update` activity containing the `Question` object with updated results. This activity MUST be delivered to the audience of the poll and to every actor that voted in the poll.
|
||||
|
||||
### Closing a poll
|
||||
|
||||
A poll is considered to be closed once the date specified by the `endTime` property has been reached. Implementations MAY add the `closed` property to explicitly specify the date when the poll was closed.
|
||||
|
||||
## Editing options
|
||||
|
||||
The type of a poll (single choice / multiple choices) and its options might be changed at any time. In that case the author of the poll MUST reset the vote counts.
|
||||
@@ -158,6 +172,10 @@ The type of a poll (single choice / multiple choices) and its options might be c
|
||||
|
||||
The method of identifying votes described in this document is not reliable because a reply can look exactly like a vote. Alternative representations are being discussed (e.g. the `Respond` activity).
|
||||
|
||||
## JSON schemas
|
||||
|
||||
- [Question object](./question.schema.json)
|
||||
|
||||
## Implementations
|
||||
|
||||
This document is based on implementations of polls in Mastodon and Pleroma.
|
||||
|
||||
Reference in New Issue
Block a user