From 375635c797ac6466678626bbfc8752c187a4081a Mon Sep 17 00:00:00 2001 From: Ramon Souza Date: Tue, 7 Jun 2022 16:54:09 -0300 Subject: [PATCH 1/2] re-sub to current poll when presenter changes --- bigbluebutton-html5/imports/api/polls/server/publishers.js | 4 +++- .../imports/ui/components/poll/container.jsx | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/imports/api/polls/server/publishers.js b/bigbluebutton-html5/imports/api/polls/server/publishers.js index eb0261fb11..466dc1f9e0 100644 --- a/bigbluebutton-html5/imports/api/polls/server/publishers.js +++ b/bigbluebutton-html5/imports/api/polls/server/publishers.js @@ -12,8 +12,10 @@ Meteor.server.setPublicationStrategy('polls', DDPServer.publicationStrategies.NO const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator; -function currentPoll(secretPoll) { +function currentPoll(secretPoll, amIPresenter) { check(secretPoll, Boolean); + check(amIPresenter, Boolean); + const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id, }); diff --git a/bigbluebutton-html5/imports/ui/components/poll/container.jsx b/bigbluebutton-html5/imports/ui/components/poll/container.jsx index f9e77fe885..43813c983f 100644 --- a/bigbluebutton-html5/imports/ui/components/poll/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/poll/container.jsx @@ -22,6 +22,9 @@ const PollContainer = ({ ...props }) => { const { users } = usingUsersContext; const amIPresenter = users[Auth.meetingID][Auth.userID].presenter; + const isPollSecret = Session.get('secretPoll') || false; + Meteor.subscribe('current-poll', isPollSecret, amIPresenter); + const usernames = {}; Object.values(users[Auth.meetingID]).forEach((user) => { @@ -38,9 +41,6 @@ const PollContainer = ({ ...props }) => { }; export default withTracker(() => { - const isPollSecret = Session.get('secretPoll') || false; - Meteor.subscribe('current-poll', isPollSecret); - const currentPresentation = Presentations.findOne({ current: true, }, { fields: { podId: 1 } }) || {}; From 507a594cae543c6d89a18320c05559984f467489 Mon Sep 17 00:00:00 2001 From: Ramon Souza Date: Wed, 8 Jun 2022 09:40:24 -0300 Subject: [PATCH 2/2] remove unused code --- bigbluebutton-html5/imports/api/polls/server/publishers.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bigbluebutton-html5/imports/api/polls/server/publishers.js b/bigbluebutton-html5/imports/api/polls/server/publishers.js index 466dc1f9e0..eb0261fb11 100644 --- a/bigbluebutton-html5/imports/api/polls/server/publishers.js +++ b/bigbluebutton-html5/imports/api/polls/server/publishers.js @@ -12,10 +12,8 @@ Meteor.server.setPublicationStrategy('polls', DDPServer.publicationStrategies.NO const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator; -function currentPoll(secretPoll, amIPresenter) { +function currentPoll(secretPoll) { check(secretPoll, Boolean); - check(amIPresenter, Boolean); - const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id, });