diff options
author | 2023-12-16 19:12:25 +0000 | |
---|---|---|
committer | 2023-12-16 19:12:25 +0000 | |
commit | 07bd84802848bf9a83683db0a1e6ada60d2f04d1 (patch) | |
tree | 5705b0330944a8500d6235b65c5b7bbdde4a3008 | |
parent | [feature] Push status edit messages into open streams (#2418) (diff) | |
download | gotosocial-07bd84802848bf9a83683db0a1e6ada60d2f04d1.tar.xz |
fix poll total vote double count (#2464)
-rw-r--r-- | internal/typeutils/internaltofrontend.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index 353c719b5..09d538a3d 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -1484,6 +1484,9 @@ func (c *Converter) PollToAPIPoll(ctx context.Context, requester *gtsmodel.Accou // disabled, or the requester is the author // do we actually populate the vote counts. + // If we voted in this poll, we'll have set totalVotes + // earlier. Reset here to avoid double counting. + totalVotes = 0 if *poll.Multiple { // The total number of voters are only // provided in the case of a multiple |