diff --git a/fep/9967/index.html b/fep/9967/index.html index 7d55516..5b2a656 100644 --- a/fep/9967/index.html +++ b/fep/9967/index.html @@ -6,7 +6,7 @@ - + @@ -721,10 +721,10 @@

Summary

-

How to make polls in ActivityPub network.

+

This FEP documents how Mastodon and other ActivityPub applications implement polls.

History

-

Mastodon implemented polls in 2019 (documentation).

ActivityStreams specification provides recommendations for representing questions, but these recommendations were found to be impractical and the de-facto standard differs from them.

+

Mastodon implemented polls in 2019 (documentation).

Requirements

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

@@ -757,7 +757,7 @@ -

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 microsyntax, the corresponding Emoji objects are added to the tag array of the Question object. The text MUST be escaped before it is included in HTML.

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.

Example:

@@ -828,17 +828,24 @@
  • The voter has a permission to vote (if the poll is not public).
  • The poll is still active (if endTime is specified).
  • The vote with the specified id is not already registered.
  • -
  • The vote with the specified name is not already registered (if multiple choices are not allowed).
  • +
  • The vote from the specified actor is not already registered (if multiple choices are not allowed).
  • +
  • The vote with the specified name is not already registered (if multiple choices are allowed).
  • If any of these checks fails, the vote MUST be ignored.

    Otherwise, the author of the poll updates the vote count for the specified poll option (the totalItems property of a corresponding replies collection). The value of the updated property is changed to the current date and time.

    Publishing results

    -

    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.

    +

    When the actor that published a poll receives a vote, it publishes an Update activity containing the Question object with updated results. This activity MUST be immediately delivered to the actor that sent the vote. It SHOULD also be delivered to the audience of the poll and to every actor that voted in the poll. Debouncing MAY be applied.

    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.

    +

    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 it:

    +

    Future work

    +

    In order to address poll voters correctly in Update activities, a collection of voters needs to be introduced. This collection could be attached to a Question object using the voters property.

    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