From 65ff7bca6c203031dfce0e1b7fe8d7309b604a31 Mon Sep 17 00:00:00 2001
From: Joao Siebel <joaos_desenv@imdt.com.br>
Date: Fri, 2 Jul 2021 16:47:00 -0300
Subject: [PATCH] Hide poll responses and number of votes for viewers in
 minimongo

---
 .../imports/api/polls/server/publishers.js             | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bigbluebutton-html5/imports/api/polls/server/publishers.js b/bigbluebutton-html5/imports/api/polls/server/publishers.js
index 53ebb41711..85bbd08b06 100644
--- a/bigbluebutton-html5/imports/api/polls/server/publishers.js
+++ b/bigbluebutton-html5/imports/api/polls/server/publishers.js
@@ -29,7 +29,6 @@ function publishCurrentPoll(...args) {
 
 Meteor.publish('current-poll', publishCurrentPoll);
 
-
 function polls() {
   const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id });
 
@@ -38,6 +37,13 @@ function polls() {
     return Polls.find({ meetingId: '' });
   }
 
+  const options = {
+    fields: {
+      'answers.numVotes': 0,
+      responses: 0,
+    },
+  };
+
   const { meetingId, userId } = tokenValidation;
 
   Logger.debug('Publishing polls', { meetingId, userId });
@@ -47,7 +53,7 @@ function polls() {
     users: userId,
   };
 
-  return Polls.find(selector);
+  return Polls.find(selector, options);
 }
 
 function publish(...args) {
-- 
GitLab