diff options
author | Joas Schilling <coding@schilljs.com> | 2022-05-16 16:30:08 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-06-13 12:52:58 +0200 |
commit | d8fd68d84a17bdfaf7e438d910f78d0a02036f29 (patch) | |
tree | 801877c66d25ebccd344b5d7d3ab8d2f3d9559c4 /lib/Controller/PollController.php | |
parent | 30c41a8fff35ed77f9a7ced277f64e665a5b03c3 (diff) |
Store the summary as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PollController.php')
-rw-r--r-- | lib/Controller/PollController.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php index 2aeaefa33..702d21721 100644 --- a/lib/Controller/PollController.php +++ b/lib/Controller/PollController.php @@ -199,7 +199,11 @@ class PollController extends AEnvironmentAwareController { $data = $poll->asArray(); unset($data['roomId']); - $data['voted'] = array_map(static fn (Vote $vote) => $vote->getOptionId(), $votes); + if ($poll->getResultMode() === Poll::MODE_HIDDEN && $poll->getStatus() === Poll::STATUS_OPEN) { + $data['votes'] = []; + } + + $data['votedSelf'] = array_map(static fn (Vote $vote) => $vote->getOptionId(), $votes); return $data; } |