From 82a40e4d9a46a3a347021d1abdba9ab6b14ccbcb Mon Sep 17 00:00:00 2001 From: Maxim Khlobystov Date: Tue, 6 Feb 2018 11:23:51 -0500 Subject: [PATCH 01/21] Handle voice users message to update the voice states properly on reconnect. --- .../api/voice-users/server/eventHandlers.js | 2 + .../server/handlers/getVoiceUsers.js | 63 +++++++++++++++++++ .../server/modifiers/updateVoiceUser.js | 1 + 3 files changed, 66 insertions(+) create mode 100644 bigbluebutton-html5/imports/api/voice-users/server/handlers/getVoiceUsers.js diff --git a/bigbluebutton-html5/imports/api/voice-users/server/eventHandlers.js b/bigbluebutton-html5/imports/api/voice-users/server/eventHandlers.js index 8dc678dbcd..527325509d 100644 --- a/bigbluebutton-html5/imports/api/voice-users/server/eventHandlers.js +++ b/bigbluebutton-html5/imports/api/voice-users/server/eventHandlers.js @@ -3,8 +3,10 @@ import handleJoinVoiceUser from './handlers/joinVoiceUser'; import handleLeftVoiceUser from './handlers/leftVoiceUser'; import handleTalkingVoiceUser from './handlers/talkingVoiceUser'; import handleMutedVoiceUser from './handlers/mutedVoiceUser'; +import handleGetVoiceUsers from './handlers/getVoiceUsers'; RedisPubSub.on('UserLeftVoiceConfToClientEvtMsg', handleLeftVoiceUser); RedisPubSub.on('UserJoinedVoiceConfToClientEvtMsg', handleJoinVoiceUser); RedisPubSub.on('UserTalkingVoiceEvtMsg', handleTalkingVoiceUser); RedisPubSub.on('UserMutedVoiceEvtMsg', handleMutedVoiceUser); +RedisPubSub.on('GetVoiceUsersMeetingRespMsg', handleGetVoiceUsers); diff --git a/bigbluebutton-html5/imports/api/voice-users/server/handlers/getVoiceUsers.js b/bigbluebutton-html5/imports/api/voice-users/server/handlers/getVoiceUsers.js new file mode 100644 index 0000000000..d66ec2f1de --- /dev/null +++ b/bigbluebutton-html5/imports/api/voice-users/server/handlers/getVoiceUsers.js @@ -0,0 +1,63 @@ +import { check } from 'meteor/check'; +import VoiceUsers from '/imports/api/voice-users/'; +import Meetings from '/imports/api/meetings'; +import addVoiceUser from '../modifiers/addVoiceUser'; +import removeVoiceUser from '../modifiers/removeVoiceUser'; +import updateVoiceUser from '../modifiers/updateVoiceUser'; + +export default function handleGetVoiceUsers({ body }, meetingId) { + const { users } = body; + + check(meetingId, String); + check(users, Array); + + const meeting = Meetings.findOne({ meetingId: meetingId }); + const usersIds = users.map(m => m.intId); + + const voiceUsersIdsToUpdate = VoiceUsers.find({ + meetingId, + intId: { $in: usersIds }, + }).fetch().map(m => m.intId);; + + let voiceUsersUpdated = []; + users.forEach(user => { + if(voiceUsersIdsToUpdate.indexOf(user.intId) >= 0) { + // user already exist, then update + voiceUsersUpdated.push(updateVoiceUser(meetingId, { + intId: user.intId, + voiceUserId: user.voiceUserId, + talking: user.talking, + muted: user.muted, + voiceConf: meeting.voiceProp.voiceConf, + joined: true + })); + } else { + // user doesn't exist yet, then add it + addVoiceUser(meetingId, { + voiceUserId: user.voiceUserId, + intId: user.intId, + callerName: user.callerName, + callerNum: user.callerNum, + muted: user.muted, + talking: user.talking, + callingWith: user.callingWith, + listenOnly: user.listenOnly, + voiceConf: meeting.voiceProp.voiceConf, + joined: true + }); + } + }); + + // removing extra users already existing in Mongo + const voiceUsersToRemove = VoiceUsers.find({ + meetingId, + intId: { $nin: usersIds }, + }).fetch(); + voiceUsersToRemove.forEach(user => removeVoiceUser(meetingId, { + voiceConf: meeting.voiceProp.voiceConf, + voiceUserId: user.voiceUserId, + intId: user.intId + })); + + return voiceUsersUpdated; +} diff --git a/bigbluebutton-html5/imports/api/voice-users/server/modifiers/updateVoiceUser.js b/bigbluebutton-html5/imports/api/voice-users/server/modifiers/updateVoiceUser.js index 42ceb95d31..4ee402705c 100644 --- a/bigbluebutton-html5/imports/api/voice-users/server/modifiers/updateVoiceUser.js +++ b/bigbluebutton-html5/imports/api/voice-users/server/modifiers/updateVoiceUser.js @@ -11,6 +11,7 @@ export default function updateVoiceUser(meetingId, voiceUser) { talking: Match.Maybe(Boolean), muted: Match.Maybe(Boolean), voiceConf: String, + joined: Match.Maybe(Boolean) }); const { intId } = voiceUser; From 1d5bfce16765693a2a505d353b320210d6ae6b5d Mon Sep 17 00:00:00 2001 From: Augusto Bennemann Date: Thu, 18 Jan 2018 14:36:34 -0200 Subject: [PATCH 02/21] Fix share/unshare video button style and remove old files --- .../actions-bar/video-button/component.jsx | 23 ------------------- .../actions-bar/video-button/container.jsx | 0 .../video-dock/video-menu/component.jsx | 21 +++++++++++++++++ .../video-dock/video-menu/styles.scss | 15 ++++++++++++ 4 files changed, 36 insertions(+), 23 deletions(-) delete mode 100644 bigbluebutton-html5/imports/ui/components/actions-bar/video-button/component.jsx delete mode 100644 bigbluebutton-html5/imports/ui/components/actions-bar/video-button/container.jsx create mode 100644 bigbluebutton-html5/imports/ui/components/video-dock/video-menu/styles.scss diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/video-button/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/video-button/component.jsx deleted file mode 100644 index 71bd4c06e8..0000000000 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/video-button/component.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import Button from '/imports/ui/components/button/component'; -// import { styles } from '../styles.scss'; - -export default class JoinVideo extends React.Component { - - handleClick() { - } - - render() { - return ( -