1
0
mirror of https://codeberg.org/fediverse/fep.git synced 2026-08-08 05:25:47 +00:00

FEP-9967: Update proposal (#706)

- Added sequence diagram.
- Removed sentence about endless polls and changed requirement level to MAY.
- Added link to Custom emojis FEP.
- Moved note about `Respond` activity to "Future work" section.
- Updated ActivityPub author list.

Reviewed-on: https://codeberg.org/fediverse/fep/pulls/706
Co-authored-by: silverpill <silverpill@firemail.cc>
Co-committed-by: silverpill <silverpill@firemail.cc>
This commit is contained in:
silverpill
2025-10-26 21:46:33 +01:00
committed by silverpill
parent cadd0a521a
commit b88a4453cb
+26 -6
View File
@@ -23,6 +23,23 @@ ActivityStreams specification provides [recommendations](https://www.w3.org/TR/a
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC-2119].
## Overview
```mermaid
sequenceDiagram
actor Alice
actor Bob
actor Charlie
Note right of Alice: Alice publishes a poll
Alice ->> Bob: Create(Question)
Alice ->> Charlie: Create(Question)
Note left of Bob: Bob votes
Bob ->> Alice: Create(Note)
Note right of Alice: Alice receives the vote and updates poll results
Alice ->> Bob: Update(Question)
Alice ->> Charlie: Update(Question)
```
## Question object
A poll is represented by a `Question` object. It MUST be published with `Create` activity (in contrast with [ActivityStreams vocabulary][ActivityVocabulary] where `Question` itself is defined as intransitive activity).
@@ -40,11 +57,11 @@ The value of this property MUST be an array of objects representing poll options
- `type`: the `Collection` string.
- `totalItems`: the total number of votes for this poll option.
The `name` of a poll option MUST be unique within a poll. If the text contains custom emoji microsyntax, the corresponding `Emoji` objects are added to the `tag` array of the `Question` object.
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 SHOULD also have an `endTime` property indicating the time when the poll ends. Polls without ending time are not widely supported. 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 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.
@@ -118,9 +135,6 @@ Example of a vote:
The structure of a vote is very similar to a direct reply. It can be identified as a `Note` with `name` and `inReplyTo` properties, but without a `content` property.
>[!NOTE]
>The method of identifying votes described here is not reliable. An alternative representation is being discussed (the `Respond` activity).
Upon receving a vote, the author of the poll performs the following checks:
- The voter has a permission to vote (if the poll is not public).
@@ -140,21 +154,27 @@ When actor that published a poll receives a vote, it publishes an `Update` activ
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.
## Future work
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).
## Implementations
This document is based on implementations of polls in Mastodon and Pleroma.
## References
- Christine Lemmer Webber, Jessica Tallon, [ActivityPub][ActivityPub], 2018
- Christine Lemmer-Webber, Jessica Tallon, Erin Shepherd, Amy Guy, Evan Prodromou, [ActivityPub], 2018
- James M Snell, Evan Prodromou, [Activity Vocabulary][ActivityVocabulary], 2017
- S. Bradner, [Key words for use in RFCs to Indicate Requirement Levels][RFC-2119], 1997
- Mastodon contributors, [Polls][MastodonPolls]
- silverpill, [FEP-9098: Custom emojis][FEP-9098], 2025
[ActivityPub]: https://www.w3.org/TR/activitypub/
[ActivityVocabulary]: https://www.w3.org/TR/activitystreams-vocabulary/
[RFC-2119]: https://tools.ietf.org/html/rfc2119.html
[MastodonPolls]: https://docs.joinmastodon.org/spec/activitypub/#Question
[FEP-9098]: https://codeberg.org/fediverse/fep/src/branch/main/fep/9098/fep-9098.md
## Copyright