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

Deploying from 3fa9c4a7f2 [SKIP CI]

This commit is contained in:
silverpill
2026-05-24 14:31:53 +00:00
parent 746562bb8e
commit 3611a1999d
2 changed files with 64 additions and 3 deletions
+63 -2
View File
@@ -519,6 +519,34 @@
</span>
</a>
<nav class="md-nav" aria-label="Question object">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#counting-voters" class="md-nav__link">
<span class="md-ellipsis">
Counting voters
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#limits" class="md-nav__link">
<span class="md-ellipsis">
Limits
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
@@ -564,6 +592,17 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#closing-a-poll" class="md-nav__link">
<span class="md-ellipsis">
Closing a poll
</span>
</a>
</li>
</ul>
@@ -591,6 +630,17 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#json-schemas" class="md-nav__link">
<span class="md-ellipsis">
JSON schemas
</span>
</a>
</li>
<li class="md-nav__item">
@@ -708,7 +758,6 @@
</li>
</ul>
<p>The <code>name</code> of a poll option MUST be unique within a poll. If the text contains <a href="https://codeberg.org/fediverse/fep/src/branch/main/fep/9098/fep-9098.md">custom emoji</a> microsyntax, the corresponding <code>Emoji</code> objects are added to the <code>tag</code> array of the <code>Question</code> object.</p>
<p>The number of poll options is often limited, but the limit differs between implementations.</p>
<p><code>Question</code> objects MAY have an <code>endTime</code> property indicating the time when the poll ends. Some implementations use <code>closed</code> property instead of <code>endTime</code> or in addition to it (even if the poll is open). Consumers MUST process <code>closed</code> in the same way as <code>endTime</code>.</p>
<p><code>Question</code> objects SHOULD have an <code>updated</code> property.</p>
<p>Example:</p>
@@ -741,6 +790,12 @@
<span class="w"> </span><span class="p">]</span>
<span class="p">}</span>
</code></pre></div>
<h3 id="counting-voters">Counting voters<a class="headerlink" href="#counting-voters" title="Permanent link">&para;</a></h3>
<p>The <a href="https://docs.joinmastodon.org/spec/activitypub/#poll-specific-properties"><code>votersCount</code></a> property can be used to specify how many people have voted in a poll.</p>
<p>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.</p>
<h3 id="limits">Limits<a class="headerlink" href="#limits" title="Permanent link">&para;</a></h3>
<p>The number of poll options is often limited, but the limit differs between implementations.</p>
<p>Mastodon allows up to <a href="https://github.com/mastodon/mastodon/blob/v4.5.9/FEDERATION.md#size-limits">500 options</a> per poll.</p>
<h2 id="voting">Voting<a class="headerlink" href="#voting" title="Permanent link">&para;</a></h2>
<h3 id="vote-object">Vote object<a class="headerlink" href="#vote-object" title="Permanent link">&para;</a></h3>
<p>A vote is represented by a <code>Note</code> object with the following structure:</p>
@@ -753,7 +808,7 @@
<li><code>to</code>: the author of the poll.</li>
</ul>
<p>The object MUST NOT have a <code>content</code> property.</p>
<p>This object is wrapped in a <code>Create</code> activity and sent to the author of the poll. If the poll is anonymous, this activity MUST NOT be delivered to anyone else.</p>
<p>This object is wrapped in a <code>Create</code> activity and sent to the author of the poll. If the poll is anonymous, this activity is not delivered to anyone else.</p>
<p>When a poll allows multiple choices, each vote MUST be sent as a separate activity.</p>
<p>Example of a vote:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
@@ -779,10 +834,16 @@
<p>Otherwise, the author of the poll updates the vote count for the specified poll option (the <code>totalItems</code> property of a corresponding <code>replies</code> collection). The value of the <code>updated</code> property is changed to the current date and time.</p>
<h3 id="publishing-results">Publishing results<a class="headerlink" href="#publishing-results" title="Permanent link">&para;</a></h3>
<p>When actor that published a poll receives a vote, it publishes an <code>Update</code> activity containing the <code>Question</code> object with updated results. This activity MUST be delivered to the audience of the poll and to every actor that voted in the poll.</p>
<h3 id="closing-a-poll">Closing a poll<a class="headerlink" href="#closing-a-poll" title="Permanent link">&para;</a></h3>
<p>A poll is considered to be closed once the date specified by the <code>endTime</code> property has been reached. Implementations MAY add the <code>closed</code> property to explicitly specify the date when the poll was closed.</p>
<h2 id="editing-options">Editing options<a class="headerlink" href="#editing-options" title="Permanent link">&para;</a></h2>
<p>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.</p>
<h2 id="future-work">Future work<a class="headerlink" href="#future-work" title="Permanent link">&para;</a></h2>
<p>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 <code>Respond</code> activity).</p>
<h2 id="json-schemas">JSON schemas<a class="headerlink" href="#json-schemas" title="Permanent link">&para;</a></h2>
<ul>
<li><a href="question.schema.json">Question object</a></li>
</ul>
<h2 id="implementations">Implementations<a class="headerlink" href="#implementations" title="Permanent link">&para;</a></h2>
<p>This document is based on implementations of polls in Mastodon and Pleroma.</p>
<p>Several projects announced support for this FEP after it was published:</p>
File diff suppressed because one or more lines are too long