[backend/federation] Fix remote poll voter counts (ISH-363)
This commit is contained in:
parent
8b36f1aecf
commit
946eed1b03
1 changed files with 4 additions and 0 deletions
|
@ -24,6 +24,10 @@ public class PollService(
|
|||
return;
|
||||
}
|
||||
|
||||
if (updateVotersCount)
|
||||
await db.Database
|
||||
.ExecuteSqlAsync($"""UPDATE "poll" SET "votersCount" = GREATEST("votersCount", (SELECT COUNT(*) FROM (SELECT DISTINCT "userId" FROM "poll_vote" WHERE "noteId" = {poll.NoteId}) AS sq)::integer) WHERE "noteId" = {poll.NoteId};""");
|
||||
|
||||
var vote = activityRenderer.RenderVote(pollVote, poll, note);
|
||||
var actor = userRenderer.RenderLite(pollVote.User);
|
||||
var activity = ActivityPub.ActivityRenderer.RenderCreate(vote, actor);
|
||||
|
|
Loading…
Add table
Reference in a new issue