A Discord poll is drawn in the log - extract_poll reads the question and the answers
(backend/discord.rs:2142) - and that is as far as it goes. votePoll
(rpc/methods.rs:2945) dispatches to Matrix and to Kick and answers "that is not a
Kick channel" for a Discord buffer, so the one thing a poll exists for cannot be
done here.
Kick and Matrix polls are both votable in moho already. Discord is the odd one out.
What is needed
POST /channels/{channel_id}/polls/{message_id}/answers/@me with the chosen answer
id, through send_write so it obeys the pacing layer.
A Discord branch in votePoll rather than a second method - the client already
calls one method for whatever service the conversation belongs to.
The result tally arrives on MESSAGE_UPDATE, which is already handled; the poll
card should redraw from it.
Done looks like: pressing an answer in a Discord poll votes, and the counts move.
Reference: the official Discord client. Follows #109's card work.
A Discord poll is drawn in the log - `extract_poll` reads the question and the answers
(`backend/discord.rs:2142`) - and that is as far as it goes. `votePoll`
(`rpc/methods.rs:2945`) dispatches to Matrix and to Kick and answers **"that is not a
Kick channel"** for a Discord buffer, so the one thing a poll exists for cannot be
done here.
Kick and Matrix polls are both votable in moho already. Discord is the odd one out.
**What is needed**
- `POST /channels/{channel_id}/polls/{message_id}/answers/@me` with the chosen answer
id, through `send_write` so it obeys the pacing layer.
- A Discord branch in `votePoll` rather than a second method - the client already
calls one method for whatever service the conversation belongs to.
- The result tally arrives on `MESSAGE_UPDATE`, which is already handled; the poll
card should redraw from it.
**Done looks like:** pressing an answer in a Discord poll votes, and the counts move.
Reference: the official Discord client. Follows #109's card work.
A Discord poll now lands on the same card a Kick poll or a Matrix one does - one question with a set of answers and a tally is one shape whoever is asking - so this was a card builder, somewhere to announce from, and a Discord branch in votePoll rather than a second method. PUT /channels/{id}/polls/{message_id}/answers/@me, through send_write so it is paced like everything else this account does rather than reads.
Three things the payload's shape forced, worth writing down:
A Discord poll is part of a message rather than an event of its own, so the card's id is the message id - that is what a vote is addressed to.
The announce sits above the MESSAGE_UPDATE handler's early return. An update carrying a recounted tally has no edit stamp and no embeds, so it would otherwise have been read as nothing having happened - which would have meant the counts never moved.
answer_counts is absent entirely until the first vote, so a missing entry is nought rather than missing data.
A poll is treated as shut two ways: Discord saying the counting is finalised, and a clock that has run out while Discord has not got round to saying so. Offering a vote that would be refused is worse than saying it is closed.
History announces a poll too, but only while it is still running. Discord's polls last hours or days, so one posted before the conversation was opened is the commonest one to meet; a finished poll is history and stays in the log where it was written.
No client change was needed - the card and votePoll were already service-agnostic.
Finished in nobilis [02e08f8](https://git.salastil.com/Salastil/nobilis/commit/02e08f8).
A Discord poll now lands on the same card a Kick poll or a Matrix one does - one question with a set of answers and a tally is one shape whoever is asking - so this was a card builder, somewhere to announce from, and a Discord branch in `votePoll` rather than a second method. `PUT /channels/{id}/polls/{message_id}/answers/@me`, through `send_write` so it is paced like everything else this account does rather than reads.
Three things the payload's shape forced, worth writing down:
- A Discord poll is part of a message rather than an event of its own, so the card's id is the **message** id - that is what a vote is addressed to.
- The announce sits **above** the MESSAGE_UPDATE handler's early return. An update carrying a recounted tally has no edit stamp and no embeds, so it would otherwise have been read as nothing having happened - which would have meant the counts never moved.
- `answer_counts` is absent entirely until the first vote, so a missing entry is nought rather than missing data.
A poll is treated as shut two ways: Discord saying the counting is finalised, and a clock that has run out while Discord has not got round to saying so. Offering a vote that would be refused is worse than saying it is closed.
History announces a poll too, but only while it is still running. Discord's polls last hours or days, so one posted before the conversation was opened is the commonest one to meet; a finished poll is history and stays in the log where it was written.
No client change was needed - the card and `votePoll` were already service-agnostic.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
A Discord poll is drawn in the log -
extract_pollreads the question and the answers(
backend/discord.rs:2142) - and that is as far as it goes.votePoll(
rpc/methods.rs:2945) dispatches to Matrix and to Kick and answers "that is not aKick channel" for a Discord buffer, so the one thing a poll exists for cannot be
done here.
Kick and Matrix polls are both votable in moho already. Discord is the odd one out.
What is needed
POST /channels/{channel_id}/polls/{message_id}/answers/@mewith the chosen answerid, through
send_writeso it obeys the pacing layer.votePollrather than a second method - the client alreadycalls one method for whatever service the conversation belongs to.
MESSAGE_UPDATE, which is already handled; the pollcard should redraw from it.
Done looks like: pressing an answer in a Discord poll votes, and the counts move.
Reference: the official Discord client. Follows #109's card work.
Finished in nobilis 02e08f8.
A Discord poll now lands on the same card a Kick poll or a Matrix one does - one question with a set of answers and a tally is one shape whoever is asking - so this was a card builder, somewhere to announce from, and a Discord branch in
votePollrather than a second method.PUT /channels/{id}/polls/{message_id}/answers/@me, throughsend_writeso it is paced like everything else this account does rather than reads.Three things the payload's shape forced, worth writing down:
answer_countsis absent entirely until the first vote, so a missing entry is nought rather than missing data.A poll is treated as shut two ways: Discord saying the counting is finalised, and a clock that has run out while Discord has not got round to saying so. Offering a vote that would be refused is worse than saying it is closed.
History announces a poll too, but only while it is still running. Discord's polls last hours or days, so one posted before the conversation was opened is the commonest one to meet; a finished poll is history and stays in the log where it was written.
No client change was needed - the card and
votePollwere already service-agnostic.