From 6766e8ce74171cc440fe01163a33eadc56707d73 Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Mon, 9 Oct 2017 15:04:19 -0700 Subject: [PATCH 01/37] make whiteboard click through when not drawing as expected --- .../bigbluebutton/modules/whiteboard/views/WhiteboardCanvas.as | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardCanvas.as b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardCanvas.as index bd3f9dc173..153d0ee738 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardCanvas.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardCanvas.as @@ -76,6 +76,7 @@ package org.bigbluebutton.modules.whiteboard.views { whiteboardToolbar.whiteboardAccessModified(wbModel.multiUser); this.clipContent = true; + this.mouseEnabled = false; //create the annotation display container this.addChild(graphicObjectHolder); @@ -119,12 +120,14 @@ package org.bigbluebutton.modules.whiteboard.views { addEventListener(MouseEvent.MOUSE_DOWN, doMouseDown); addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); + mouseEnabled = true; } private function unregisterForMouseEvents():void { removeEventListener(MouseEvent.MOUSE_DOWN, doMouseDown); removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver); removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut); + mouseEnabled = false; } private function doMouseUp(event:MouseEvent):void { From 21dcafb047b3b60dca4d312c622dba83862416a4 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhurbenko Date: Wed, 11 Oct 2017 12:11:04 -0700 Subject: [PATCH 02/37] Fixed some of the console warning happenning when user is a moderator and he opens user-list/chat --- .../imports/ui/components/app/container.jsx | 5 +---- .../ui/components/chat/chat-dropdown/component.jsx | 2 +- .../ui/components/dropdown/trigger/component.jsx | 12 +++++++++++- .../user-participants/component.jsx | 1 - 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx index 4813274ec0..6926b0688b 100644 --- a/bigbluebutton-html5/imports/ui/components/app/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx @@ -28,7 +28,6 @@ const propTypes = { actionsbar: PropTypes.node, media: PropTypes.node, location: PropTypes.object.isRequired, - children: PropTypes.node.isRequired, }; const defaultProps = { @@ -69,9 +68,7 @@ const AppContainer = (props) => { actionsbar={actionsbar} media={media} {...otherProps} - > - {props.children} - + /> ); }; diff --git a/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx index 894ec742b1..905c88571b 100644 --- a/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/chat-dropdown/component.jsx @@ -120,7 +120,7 @@ class ChatDropdown extends Component { > diff --git a/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx b/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx index a55cb8a379..65bd7dd548 100644 --- a/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx @@ -41,7 +41,17 @@ export default class DropdownTrigger extends Component { } render() { - const { children, className, ...restProps } = this.props; + const remainingProps = Object.assign({}, this.props); + delete remainingProps.dropdownToggle; + delete remainingProps.dropdownShow; + delete remainingProps.dropdownHide; + + const { + children, + className, + ...restProps + } = remainingProps; + const TriggerComponent = React.Children.only(children); const TriggerComponentBounded = React.cloneElement(TriggerComponent, { diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/component.jsx index e3100b4bd5..f0f90c541c 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/component.jsx @@ -191,7 +191,6 @@ class UserParticipants extends Component { className={styles.scrollableList} role="tabpanel" tabIndex={0} - refScrollContainer ref={(ref) => { this.refScrollContainer = ref; }} > Date: Thu, 12 Oct 2017 14:16:34 -0400 Subject: [PATCH 03/37] Handle out of order inserts at the start of a caption stream. If you're inserting at position 0 (and there was no previous deleted text from that position), you can't use the timestamp from the previous character position, since there's no previous character. Use the timestamp of the following character instead. --- record-and-playback/core/scripts/utils/gen_webvtt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/record-and-playback/core/scripts/utils/gen_webvtt b/record-and-playback/core/scripts/utils/gen_webvtt index aedbf721eb..0221a4ccb5 100755 --- a/record-and-playback/core/scripts/utils/gen_webvtt +++ b/record-and-playback/core/scripts/utils/gen_webvtt @@ -72,8 +72,11 @@ class Caption: if i < len(self.timestamps) and timestamp > self.timestamps[i]: timestamp = self._del_timestamps[i] - if timestamp is None and i > 0: - timestamp = self.timestamps[i-1] + if timestamp is None: + if i > 0: + timestamp = self.timestamps[i-1] + else: + timestamp = self.timestamps[i] logger.debug("Out of order timestamps, using ts: %d", timestamp) self._del_timestamps[i:j] = [del_timestamp] * len(text) From 430ddc0d3b856a73968b230ddb181a79a1ee3e12 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhurbenko Date: Thu, 12 Oct 2017 12:07:02 -0700 Subject: [PATCH 04/37] Removing unnecessary 2x from the collections, publishers, subscriptions and logs --- .../annotations/server/modifiers/addAnnotation.js | 6 +++--- .../annotations/server/modifiers/clearAnnotations.js | 6 +++--- .../imports/api/annotations/server/publishers.js | 2 +- bigbluebutton-html5/imports/api/breakouts/index.js | 2 +- .../imports/api/breakouts/server/publishers.js | 4 ++-- bigbluebutton-html5/imports/api/captions/index.js | 2 +- .../api/captions/server/modifiers/addCaption.js | 6 +++--- .../api/captions/server/modifiers/clearCaptions.js | 4 ++-- .../imports/api/captions/server/publishers.js | 4 ++-- bigbluebutton-html5/imports/api/chat/index.js | 2 +- .../imports/api/chat/server/publishers.js | 2 +- bigbluebutton-html5/imports/api/cursor/index.js | 2 +- .../imports/api/cursor/server/publishers.js | 4 ++-- bigbluebutton-html5/imports/api/meetings/index.js | 2 +- .../api/meetings/server/modifiers/addMeeting.js | 4 ++-- .../imports/api/meetings/server/publishers.js | 4 ++-- bigbluebutton-html5/imports/api/polls/index.js | 2 +- .../imports/api/polls/server/methods/publishVote.js | 4 ++-- .../imports/api/polls/server/modifiers/addPoll.js | 6 +++--- .../imports/api/polls/server/modifiers/clearPolls.js | 4 ++-- .../imports/api/polls/server/modifiers/removePoll.js | 4 ++-- .../api/polls/server/modifiers/updateVotes.js | 4 ++-- .../imports/api/polls/server/publishers.js | 4 ++-- .../imports/api/presentations/index.js | 2 +- .../server/handlers/presentationConversionUpdate.js | 6 +++--- .../server/modifiers/addPresentation.js | 6 +++--- .../server/modifiers/clearPresentations.js | 2 +- .../server/modifiers/setCurrentPresentation.js | 4 ++-- .../imports/api/presentations/server/publishers.js | 4 ++-- bigbluebutton-html5/imports/api/slides/index.js | 2 +- .../imports/api/slides/server/publishers.js | 2 +- bigbluebutton-html5/imports/api/users/index.js | 2 +- .../imports/api/users/server/methods.js | 2 +- .../api/users/server/methods/validateAuthToken.js | 4 ++-- .../api/users/server/modifiers/createDummyUser.js | 4 ++-- .../imports/api/users/server/publishers.js | 6 +++--- bigbluebutton-html5/imports/startup/client/base.jsx | 4 ++-- bigbluebutton-html5/imports/startup/server/redis.js | 12 ++++++------ .../imports/ui/services/auth/index.js | 8 ++++---- 39 files changed, 77 insertions(+), 77 deletions(-) diff --git a/bigbluebutton-html5/imports/api/annotations/server/modifiers/addAnnotation.js b/bigbluebutton-html5/imports/api/annotations/server/modifiers/addAnnotation.js index ac1c2fc613..ba11154b81 100644 --- a/bigbluebutton-html5/imports/api/annotations/server/modifiers/addAnnotation.js +++ b/bigbluebutton-html5/imports/api/annotations/server/modifiers/addAnnotation.js @@ -357,15 +357,15 @@ export default function addAnnotation(meetingId, whiteboardId, userId, annotatio const cb = (err, numChanged) => { if (err) { - return Logger.error(`Adding annotation2x to collection: ${err}`); + return Logger.error(`Adding annotation to collection: ${err}`); } const { insertedId } = numChanged; if (insertedId) { - return Logger.info(`Added annotation2x id=${annotation.id} whiteboard=${whiteboardId}`); + return Logger.info(`Added annotation id=${annotation.id} whiteboard=${whiteboardId}`); } - return Logger.info(`Upserted annotation2x id=${annotation.id} whiteboard=${whiteboardId}`); + return Logger.info(`Upserted annotation id=${annotation.id} whiteboard=${whiteboardId}`); }; return Annotations.upsert(query.selector, query.modifier, cb); diff --git a/bigbluebutton-html5/imports/api/annotations/server/modifiers/clearAnnotations.js b/bigbluebutton-html5/imports/api/annotations/server/modifiers/clearAnnotations.js index 8873ca47ca..c543326780 100644 --- a/bigbluebutton-html5/imports/api/annotations/server/modifiers/clearAnnotations.js +++ b/bigbluebutton-html5/imports/api/annotations/server/modifiers/clearAnnotations.js @@ -18,7 +18,7 @@ export default function clearAnnotations(meetingId, whiteboardId, userId) { const cb = (err) => { if (err) { - return Logger.error(`Removing Shapes2x from collection: ${err}`); + return Logger.error(`Removing Annotations from collection: ${err}`); } if (!meetingId) { @@ -26,10 +26,10 @@ export default function clearAnnotations(meetingId, whiteboardId, userId) { } if (userId) { - return Logger.info(`Removed Shapes2x for userId=${userId} where whiteboard=${whiteboardId}`); + return Logger.info(`Removed Annotations for userId=${userId} where whiteboard=${whiteboardId}`); } - return Logger.info(`Removed Shapes2x where whiteboard=${whiteboardId}`); + return Logger.info(`Removed Annotations where whiteboard=${whiteboardId}`); }; return Annotations.remove(selector, cb); diff --git a/bigbluebutton-html5/imports/api/annotations/server/publishers.js b/bigbluebutton-html5/imports/api/annotations/server/publishers.js index 06d085e598..e682fcb49c 100644 --- a/bigbluebutton-html5/imports/api/annotations/server/publishers.js +++ b/bigbluebutton-html5/imports/api/annotations/server/publishers.js @@ -11,7 +11,7 @@ function annotations(credentials) { check(requesterUserId, String); check(requesterToken, String); - Logger.info(`Publishing Annotations2x for ${meetingId} ${requesterUserId} ${requesterToken}`); + Logger.info(`Publishing Annotations for ${meetingId} ${requesterUserId} ${requesterToken}`); return Annotations.find({ meetingId }); } diff --git a/bigbluebutton-html5/imports/api/breakouts/index.js b/bigbluebutton-html5/imports/api/breakouts/index.js index 09388c9cc0..41c6ed54e4 100644 --- a/bigbluebutton-html5/imports/api/breakouts/index.js +++ b/bigbluebutton-html5/imports/api/breakouts/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Breakouts = new Mongo.Collection('breakouts2x'); +const Breakouts = new Mongo.Collection('breakouts'); if (Meteor.isServer) { // types of queries for the breakouts: diff --git a/bigbluebutton-html5/imports/api/breakouts/server/publishers.js b/bigbluebutton-html5/imports/api/breakouts/server/publishers.js index 6efb01dd1f..f61d464c0c 100644 --- a/bigbluebutton-html5/imports/api/breakouts/server/publishers.js +++ b/bigbluebutton-html5/imports/api/breakouts/server/publishers.js @@ -9,7 +9,7 @@ function breakouts(credentials) { requesterUserId, } = credentials; - Logger.info(`Publishing Breakouts2x for ${meetingId} ${requesterUserId}`); + Logger.info(`Publishing Breakouts for ${meetingId} ${requesterUserId}`); return Breakouts.find({ $or: [ @@ -29,4 +29,4 @@ function publish(...args) { return mapToAcl('subscriptions.breakouts', boundBreakouts)(args); } -Meteor.publish('breakouts2x', publish); +Meteor.publish('breakouts', publish); diff --git a/bigbluebutton-html5/imports/api/captions/index.js b/bigbluebutton-html5/imports/api/captions/index.js index 657d998ccf..b5d076f34b 100644 --- a/bigbluebutton-html5/imports/api/captions/index.js +++ b/bigbluebutton-html5/imports/api/captions/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Captions = new Mongo.Collection('captions2x'); +const Captions = new Mongo.Collection('captions'); if (Meteor.isServer) { // types of queries for the captions: diff --git a/bigbluebutton-html5/imports/api/captions/server/modifiers/addCaption.js b/bigbluebutton-html5/imports/api/captions/server/modifiers/addCaption.js index 3b69f98023..c9642a93ee 100644 --- a/bigbluebutton-html5/imports/api/captions/server/modifiers/addCaption.js +++ b/bigbluebutton-html5/imports/api/captions/server/modifiers/addCaption.js @@ -37,15 +37,15 @@ export default function addCaption(meetingId, locale, captionHistory, id = false const cb = (err, numChanged) => { if (err) { - return Logger.error(`Adding caption2x to collection: ${err}`); + return Logger.error(`Adding caption to collection: ${err}`); } const { insertedId } = numChanged; if (insertedId) { - return Logger.verbose(`Added caption2x locale=${locale} meeting=${meetingId}`); + return Logger.verbose(`Added caption locale=${locale} meeting=${meetingId}`); } - return Logger.verbose(`Upserted caption2x locale=${locale} meeting=${meetingId}`); + return Logger.verbose(`Upserted caption locale=${locale} meeting=${meetingId}`); }; return Captions.upsert(selector, modifier, cb); diff --git a/bigbluebutton-html5/imports/api/captions/server/modifiers/clearCaptions.js b/bigbluebutton-html5/imports/api/captions/server/modifiers/clearCaptions.js index 4e492c86b0..9d10d369cd 100644 --- a/bigbluebutton-html5/imports/api/captions/server/modifiers/clearCaptions.js +++ b/bigbluebutton-html5/imports/api/captions/server/modifiers/clearCaptions.js @@ -3,8 +3,8 @@ import Logger from '/imports/startup/server/logger'; export default function clearCaptions(meetingId) { if (meetingId) { - return Captions.remove({ meetingId }, Logger.info(`Cleared Captions2x (${meetingId})`)); + return Captions.remove({ meetingId }, Logger.info(`Cleared Captions (${meetingId})`)); } - return Captions.remove({}, Logger.info('Cleared Captions2x (all)')); + return Captions.remove({}, Logger.info('Cleared Captions (all)')); } diff --git a/bigbluebutton-html5/imports/api/captions/server/publishers.js b/bigbluebutton-html5/imports/api/captions/server/publishers.js index 987ce08597..869949618a 100644 --- a/bigbluebutton-html5/imports/api/captions/server/publishers.js +++ b/bigbluebutton-html5/imports/api/captions/server/publishers.js @@ -11,7 +11,7 @@ function captions(credentials) { check(requesterUserId, String); check(requesterToken, String); - Logger.verbose(`Publishing Captions2x for ${meetingId} ${requesterUserId} ${requesterToken}`); + Logger.verbose(`Publishing Captions for ${meetingId} ${requesterUserId} ${requesterToken}`); return Captions.find({ meetingId }); } @@ -21,4 +21,4 @@ function publish(...args) { return mapToAcl('subscriptions.captions', boundCaptions)(args); } -Meteor.publish('captions2x', publish); +Meteor.publish('captions', publish); diff --git a/bigbluebutton-html5/imports/api/chat/index.js b/bigbluebutton-html5/imports/api/chat/index.js index 5338ef2f36..a28361d05c 100644 --- a/bigbluebutton-html5/imports/api/chat/index.js +++ b/bigbluebutton-html5/imports/api/chat/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Chat = new Mongo.Collection('chat2x'); +const Chat = new Mongo.Collection('chat'); if (Meteor.isServer) { // types of queries for the chat: diff --git a/bigbluebutton-html5/imports/api/chat/server/publishers.js b/bigbluebutton-html5/imports/api/chat/server/publishers.js index a5d58a409c..752e9da727 100644 --- a/bigbluebutton-html5/imports/api/chat/server/publishers.js +++ b/bigbluebutton-html5/imports/api/chat/server/publishers.js @@ -37,4 +37,4 @@ function publish(...args) { return mapToAcl('subscriptions.chat', boundChat)(args); } -Meteor.publish('chat2x', publish); +Meteor.publish('chat', publish); diff --git a/bigbluebutton-html5/imports/api/cursor/index.js b/bigbluebutton-html5/imports/api/cursor/index.js index e023b336bd..b058fa39db 100644 --- a/bigbluebutton-html5/imports/api/cursor/index.js +++ b/bigbluebutton-html5/imports/api/cursor/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Cursor = new Mongo.Collection('cursor2x'); +const Cursor = new Mongo.Collection('cursor'); if (Meteor.isServer) { // types of queries for the cursor: diff --git a/bigbluebutton-html5/imports/api/cursor/server/publishers.js b/bigbluebutton-html5/imports/api/cursor/server/publishers.js index 7710e00604..dc693e60ba 100644 --- a/bigbluebutton-html5/imports/api/cursor/server/publishers.js +++ b/bigbluebutton-html5/imports/api/cursor/server/publishers.js @@ -12,7 +12,7 @@ function cursor(credentials) { check(requesterUserId, String); check(requesterToken, String); - Logger.debug(`Publishing Cursor2x for ${meetingId} ${requesterUserId} ${requesterToken}`); + Logger.debug(`Publishing Cursor for ${meetingId} ${requesterUserId} ${requesterToken}`); return Cursor.find({ meetingId }); } @@ -22,5 +22,5 @@ function publish(...args) { return mapToAcl('subscriptions.cursor', boundCursor)(args); } -Meteor.publish('cursor2x', publish); +Meteor.publish('cursor', publish); diff --git a/bigbluebutton-html5/imports/api/meetings/index.js b/bigbluebutton-html5/imports/api/meetings/index.js index ce719639fe..1324a4a61f 100644 --- a/bigbluebutton-html5/imports/api/meetings/index.js +++ b/bigbluebutton-html5/imports/api/meetings/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Meetings = new Mongo.Collection('meetings2x'); +const Meetings = new Mongo.Collection('meetings'); if (Meteor.isServer) { // types of queries for the meetings: diff --git a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js index 8a6e28e6df..d18c312439 100644 --- a/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js +++ b/bigbluebutton-html5/imports/api/meetings/server/modifiers/addMeeting.js @@ -79,11 +79,11 @@ export default function addMeeting(meeting) { const { insertedId } = numChanged; if (insertedId) { - Logger.info(`Added meeting2x id=${meetingId}`); + Logger.info(`Added meeting id=${meetingId}`); } if (numChanged) { - Logger.info(`Upserted meeting2x id=${meetingId}`); + Logger.info(`Upserted meeting id=${meetingId}`); } }; diff --git a/bigbluebutton-html5/imports/api/meetings/server/publishers.js b/bigbluebutton-html5/imports/api/meetings/server/publishers.js index c3cc4d4044..df5b44f8df 100644 --- a/bigbluebutton-html5/imports/api/meetings/server/publishers.js +++ b/bigbluebutton-html5/imports/api/meetings/server/publishers.js @@ -11,7 +11,7 @@ function meetings(credentials) { check(requesterUserId, String); check(requesterToken, String); - Logger.info(`Publishing meeting2x =${meetingId} ${requesterUserId} ${requesterToken}`); + Logger.info(`Publishing meeting =${meetingId} ${requesterUserId} ${requesterToken}`); return Meetings.find({ meetingId, @@ -23,5 +23,5 @@ function publish(...args) { return mapToAcl('subscriptions.meetings', boundMeetings)(args); } -Meteor.publish('meetings2x', publish); +Meteor.publish('meetings', publish); diff --git a/bigbluebutton-html5/imports/api/polls/index.js b/bigbluebutton-html5/imports/api/polls/index.js index 1bb2c01a95..da84a1e417 100644 --- a/bigbluebutton-html5/imports/api/polls/index.js +++ b/bigbluebutton-html5/imports/api/polls/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Polls = new Mongo.Collection('polls2x'); +const Polls = new Mongo.Collection('polls'); if (Meteor.isServer) { // We can have just one active poll per meeting diff --git a/bigbluebutton-html5/imports/api/polls/server/methods/publishVote.js b/bigbluebutton-html5/imports/api/polls/server/methods/publishVote.js index 192c80af2c..bc59d38e06 100644 --- a/bigbluebutton-html5/imports/api/polls/server/methods/publishVote.js +++ b/bigbluebutton-html5/imports/api/polls/server/methods/publishVote.js @@ -43,10 +43,10 @@ export default function publishVote(credentials, id, pollAnswerId) { // TODO dis const cb = (err) => { if (err) { - return Logger.error(`Updating Polls2x collection: ${err}`); + return Logger.error(`Updating Polls collection: ${err}`); } - return Logger.info(`Updating Polls2x collection (meetingId: ${meetingId}, + return Logger.info(`Updating Polls collection (meetingId: ${meetingId}, pollId: ${currentPoll.id}!)`); }; diff --git a/bigbluebutton-html5/imports/api/polls/server/modifiers/addPoll.js b/bigbluebutton-html5/imports/api/polls/server/modifiers/addPoll.js index 703a9a07fb..40fa737ef1 100644 --- a/bigbluebutton-html5/imports/api/polls/server/modifiers/addPoll.js +++ b/bigbluebutton-html5/imports/api/polls/server/modifiers/addPoll.js @@ -48,15 +48,15 @@ export default function addPoll(meetingId, requesterId, poll) { const cb = (err, numChanged) => { if (err != null) { - return Logger.error(`Adding Poll2x to collection: ${poll.id}`); + return Logger.error(`Adding Poll to collection: ${poll.id}`); } const { insertedId } = numChanged; if (insertedId) { - return Logger.info(`Added Poll2x id=${poll.id}`); + return Logger.info(`Added Poll id=${poll.id}`); } - return Logger.info(`Upserted Poll2x id=${poll.id}`); + return Logger.info(`Upserted Poll id=${poll.id}`); }; return Polls.upsert(selector, modifier, cb); diff --git a/bigbluebutton-html5/imports/api/polls/server/modifiers/clearPolls.js b/bigbluebutton-html5/imports/api/polls/server/modifiers/clearPolls.js index 8461cf46b2..d614528ebf 100644 --- a/bigbluebutton-html5/imports/api/polls/server/modifiers/clearPolls.js +++ b/bigbluebutton-html5/imports/api/polls/server/modifiers/clearPolls.js @@ -3,8 +3,8 @@ import Logger from '/imports/startup/server/logger'; export default function clearPolls(meetingId) { if (meetingId) { - return Polls.remove({ meetingId }, Logger.info(`Cleared Polls2x (${meetingId})`)); + return Polls.remove({ meetingId }, Logger.info(`Cleared Polls (${meetingId})`)); } - return Polls.remove({}, Logger.info('Cleared Polls2x (all)')); + return Polls.remove({}, Logger.info('Cleared Polls (all)')); } diff --git a/bigbluebutton-html5/imports/api/polls/server/modifiers/removePoll.js b/bigbluebutton-html5/imports/api/polls/server/modifiers/removePoll.js index 92d4e5d06d..6d59f73cbd 100644 --- a/bigbluebutton-html5/imports/api/polls/server/modifiers/removePoll.js +++ b/bigbluebutton-html5/imports/api/polls/server/modifiers/removePoll.js @@ -13,10 +13,10 @@ export default function removePoll(meetingId, id) { const cb = (err) => { if (err) { - return Logger.error(`Removing Poll2x from collection: ${err}`); + return Logger.error(`Removing Poll from collection: ${err}`); } - return Logger.info(`Removed Poll2x id=${id}`); + return Logger.info(`Removed Poll id=${id}`); }; return Polls.remove(selector, cb); diff --git a/bigbluebutton-html5/imports/api/polls/server/modifiers/updateVotes.js b/bigbluebutton-html5/imports/api/polls/server/modifiers/updateVotes.js index c8b79259a0..3cb37bd1da 100644 --- a/bigbluebutton-html5/imports/api/polls/server/modifiers/updateVotes.js +++ b/bigbluebutton-html5/imports/api/polls/server/modifiers/updateVotes.js @@ -37,10 +37,10 @@ export default function updateVotes(poll, meetingId, requesterId) { const cb = (err) => { if (err) { - return Logger.error(`Updating Polls2x collection: ${err}`); + return Logger.error(`Updating Polls collection: ${err}`); } - return Logger.info(`Updating Polls2x collection (meetingId: ${meetingId}, pollId: ${id}!)`); + return Logger.info(`Updating Polls collection (meetingId: ${meetingId}, pollId: ${id}!)`); }; return Polls.update(selector, modifier, cb); diff --git a/bigbluebutton-html5/imports/api/polls/server/publishers.js b/bigbluebutton-html5/imports/api/polls/server/publishers.js index d1f9bd2152..15e9815a5c 100644 --- a/bigbluebutton-html5/imports/api/polls/server/publishers.js +++ b/bigbluebutton-html5/imports/api/polls/server/publishers.js @@ -11,7 +11,7 @@ function polls(credentials) { check(requesterUserId, String); check(requesterToken, String); - Logger.info(`Publishing polls2x =${meetingId} ${requesterUserId} ${requesterToken}`); + Logger.info(`Publishing polls =${meetingId} ${requesterUserId} ${requesterToken}`); const selector = { meetingId, @@ -26,5 +26,5 @@ function publish(...args) { return mapToAcl('subscriptions.polls', boundPolls)(args); } -Meteor.publish('polls2x', publish); +Meteor.publish('polls', publish); diff --git a/bigbluebutton-html5/imports/api/presentations/index.js b/bigbluebutton-html5/imports/api/presentations/index.js index adcc4305c5..e0df4849a0 100644 --- a/bigbluebutton-html5/imports/api/presentations/index.js +++ b/bigbluebutton-html5/imports/api/presentations/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Presentations = new Mongo.Collection('presentations2x'); +const Presentations = new Mongo.Collection('presentations'); if (Meteor.isServer) { // types of queries for the presentations: diff --git a/bigbluebutton-html5/imports/api/presentations/server/handlers/presentationConversionUpdate.js b/bigbluebutton-html5/imports/api/presentations/server/handlers/presentationConversionUpdate.js index 809660d99b..a8c1922613 100644 --- a/bigbluebutton-html5/imports/api/presentations/server/handlers/presentationConversionUpdate.js +++ b/bigbluebutton-html5/imports/api/presentations/server/handlers/presentationConversionUpdate.js @@ -71,15 +71,15 @@ export default function handlePresentationConversionUpdate({ body }, meetingId) const cb = (err, numChanged) => { if (err) { - return Logger.error(`Updating conversion status presentation2x to collection: ${err}`); + return Logger.error(`Updating conversion status presentation to collection: ${err}`); } const { insertedId } = numChanged; if (insertedId) { - return Logger.info(`Updated presentation2x conversion status=${status} id=${presentationId} meeting=${meetingId}`); + return Logger.info(`Updated presentation conversion status=${status} id=${presentationId} meeting=${meetingId}`); } - return Logger.info(`Upserted presentation2x conversion status=${status} id=${presentationId} meeting=${meetingId}`); + return Logger.info(`Upserted presentation conversion status=${status} id=${presentationId} meeting=${meetingId}`); }; return Presentations.upsert(selector, modifier, cb); diff --git a/bigbluebutton-html5/imports/api/presentations/server/modifiers/addPresentation.js b/bigbluebutton-html5/imports/api/presentations/server/modifiers/addPresentation.js index fe92821487..db07ede3a8 100644 --- a/bigbluebutton-html5/imports/api/presentations/server/modifiers/addPresentation.js +++ b/bigbluebutton-html5/imports/api/presentations/server/modifiers/addPresentation.js @@ -54,7 +54,7 @@ export default function addPresentation(meetingId, presentation) { const cb = (err, numChanged) => { if (err) { - return Logger.error(`Adding presentation2x to collection: ${err}`); + return Logger.error(`Adding presentation to collection: ${err}`); } addSlides(meetingId, presentation.id, presentation.pages); @@ -65,10 +65,10 @@ export default function addPresentation(meetingId, presentation) { setCurrentPresentation(meetingId, presentation.id); } - return Logger.info(`Added presentation2x id=${presentation.id} meeting=${meetingId}`); + return Logger.info(`Added presentation id=${presentation.id} meeting=${meetingId}`); } - return Logger.info(`Upserted presentation2x id=${presentation.id} meeting=${meetingId}`); + return Logger.info(`Upserted presentation id=${presentation.id} meeting=${meetingId}`); }; return Presentations.upsert(selector, modifier, cb); diff --git a/bigbluebutton-html5/imports/api/presentations/server/modifiers/clearPresentations.js b/bigbluebutton-html5/imports/api/presentations/server/modifiers/clearPresentations.js index b92072dc39..2d084f2b7b 100644 --- a/bigbluebutton-html5/imports/api/presentations/server/modifiers/clearPresentations.js +++ b/bigbluebutton-html5/imports/api/presentations/server/modifiers/clearPresentations.js @@ -4,7 +4,7 @@ import Logger from '/imports/startup/server/logger'; export default function clearPresentations(meetingId) { if (meetingId) { return Presentations.remove({ meetingId }, - Logger.info(`Cleared Presentations2x (${meetingId})`)); + Logger.info(`Cleared Presentations (${meetingId})`)); } return Presentations.remove({}, Logger.info('Cleared Presentations (all)')); } diff --git a/bigbluebutton-html5/imports/api/presentations/server/modifiers/setCurrentPresentation.js b/bigbluebutton-html5/imports/api/presentations/server/modifiers/setCurrentPresentation.js index d67aaf6e22..3343376422 100644 --- a/bigbluebutton-html5/imports/api/presentations/server/modifiers/setCurrentPresentation.js +++ b/bigbluebutton-html5/imports/api/presentations/server/modifiers/setCurrentPresentation.js @@ -33,10 +33,10 @@ export default function setCurrentPresentation(meetingId, presentationId) { }, callback: (err) => { if (err) { - return Logger.error(`Setting as current presentation2x id=${presentationId}: ${err}`); + return Logger.error(`Setting as current presentation id=${presentationId}: ${err}`); } - return Logger.info(`Setted as current presentation2x id=${presentationId}`); + return Logger.info(`Setted as current presentation id=${presentationId}`); }, }; diff --git a/bigbluebutton-html5/imports/api/presentations/server/publishers.js b/bigbluebutton-html5/imports/api/presentations/server/publishers.js index 23186c5ee3..4d070b9c83 100644 --- a/bigbluebutton-html5/imports/api/presentations/server/publishers.js +++ b/bigbluebutton-html5/imports/api/presentations/server/publishers.js @@ -11,7 +11,7 @@ function presentations(credentials) { check(requesterUserId, String); check(requesterToken, String); - Logger.info(`Publishing Presentations2x for ${meetingId} ${requesterUserId} ${requesterToken}`); + Logger.info(`Publishing Presentations for ${meetingId} ${requesterUserId} ${requesterToken}`); return Presentations.find({ meetingId }); } @@ -21,4 +21,4 @@ function publish(...args) { return mapToAcl('subscriptions.presentations', boundPresentations)(args); } -Meteor.publish('presentations2x', publish); +Meteor.publish('presentations', publish); diff --git a/bigbluebutton-html5/imports/api/slides/index.js b/bigbluebutton-html5/imports/api/slides/index.js index 7831569b53..8ee878085f 100644 --- a/bigbluebutton-html5/imports/api/slides/index.js +++ b/bigbluebutton-html5/imports/api/slides/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Slides = new Mongo.Collection('slides2x'); +const Slides = new Mongo.Collection('slides'); if (Meteor.isServer) { // types of queries for the slides: diff --git a/bigbluebutton-html5/imports/api/slides/server/publishers.js b/bigbluebutton-html5/imports/api/slides/server/publishers.js index 6c6054e144..f517b75382 100644 --- a/bigbluebutton-html5/imports/api/slides/server/publishers.js +++ b/bigbluebutton-html5/imports/api/slides/server/publishers.js @@ -21,4 +21,4 @@ function publish(...args) { return mapToAcl('subscriptions.slides', boundSlides)(args); } -Meteor.publish('slides2x', publish); +Meteor.publish('slides', publish); diff --git a/bigbluebutton-html5/imports/api/users/index.js b/bigbluebutton-html5/imports/api/users/index.js index 62f1d206fc..6f7e08d426 100644 --- a/bigbluebutton-html5/imports/api/users/index.js +++ b/bigbluebutton-html5/imports/api/users/index.js @@ -1,6 +1,6 @@ import { Meteor } from 'meteor/meteor'; -const Users = new Mongo.Collection('users2x'); +const Users = new Mongo.Collection('users'); if (Meteor.isServer) { // types of queries for the users: diff --git a/bigbluebutton-html5/imports/api/users/server/methods.js b/bigbluebutton-html5/imports/api/users/server/methods.js index 0e41df246f..4aa61b73a8 100644 --- a/bigbluebutton-html5/imports/api/users/server/methods.js +++ b/bigbluebutton-html5/imports/api/users/server/methods.js @@ -16,4 +16,4 @@ Meteor.methods(mapToAcl(['methods.userLogout', 'methods.setEmojiStatus', 'method kickUser, })); -Meteor.methods({ validateAuthToken2x: validateAuthToken }); +Meteor.methods({ validateAuthToken, }); diff --git a/bigbluebutton-html5/imports/api/users/server/methods/validateAuthToken.js b/bigbluebutton-html5/imports/api/users/server/methods/validateAuthToken.js index 257cc16c33..b1b3ed4adf 100644 --- a/bigbluebutton-html5/imports/api/users/server/methods/validateAuthToken.js +++ b/bigbluebutton-html5/imports/api/users/server/methods/validateAuthToken.js @@ -3,7 +3,7 @@ import { check } from 'meteor/check'; import RedisPubSub from '/imports/startup/server/redis'; import Logger from '/imports/startup/server/logger'; import Users from '/imports/api/users'; -import createDummyUser2x from '../modifiers/createDummyUser'; +import createDummyUser from '../modifiers/createDummyUser'; import setConnectionStatus from '../modifiers/setConnectionStatus'; const ONLINE_CONNECTION_STATUS = 'online'; @@ -25,7 +25,7 @@ export default function validateAuthToken(credentials) { }); if (!User) { - createDummyUser2x(meetingId, requesterUserId, requesterToken); + createDummyUser(meetingId, requesterUserId, requesterToken); } else if (User.validated) { setConnectionStatus(meetingId, requesterUserId, ONLINE_CONNECTION_STATUS); } diff --git a/bigbluebutton-html5/imports/api/users/server/modifiers/createDummyUser.js b/bigbluebutton-html5/imports/api/users/server/modifiers/createDummyUser.js index c3fe5b9497..a292b1bf07 100644 --- a/bigbluebutton-html5/imports/api/users/server/modifiers/createDummyUser.js +++ b/bigbluebutton-html5/imports/api/users/server/modifiers/createDummyUser.js @@ -3,7 +3,7 @@ import { check } from 'meteor/check'; import Logger from '/imports/startup/server/logger'; import Users from '/imports/api/users'; -export default function createDummyUser2x(meetingId, userId, authToken) { +export default function createDummyUser(meetingId, userId, authToken) { check(meetingId, String); check(userId, String); check(authToken, String); @@ -26,7 +26,7 @@ export default function createDummyUser2x(meetingId, userId, authToken) { return Logger.error(`Creating dummy user to collection: ${err}`); } - Logger.info(`Created dummy user 2x id=${userId} token=${authToken} meeting=${meetingId}`); + Logger.info(`Created dummy user id=${userId} token=${authToken} meeting=${meetingId}`); }; return Users.insert(doc, cb); diff --git a/bigbluebutton-html5/imports/api/users/server/publishers.js b/bigbluebutton-html5/imports/api/users/server/publishers.js index 2025720254..a75d672863 100644 --- a/bigbluebutton-html5/imports/api/users/server/publishers.js +++ b/bigbluebutton-html5/imports/api/users/server/publishers.js @@ -6,7 +6,7 @@ import mapToAcl from '/imports/startup/mapToAcl'; import userLeaving from './methods/userLeaving'; -Meteor.publish('current-user2x', (credentials) => { +Meteor.publish('current-user', (credentials) => { const { meetingId, requesterUserId, requesterToken } = credentials; check(meetingId, String); @@ -57,7 +57,7 @@ function users(credentials) { }, }; - Logger.info(`Publishing Users2x for ${meetingId} ${requesterUserId} ${requesterToken}`); + Logger.info(`Publishing Users for ${meetingId} ${requesterUserId} ${requesterToken}`); return Users.find(selector, options); } @@ -67,4 +67,4 @@ function publish(...args) { return mapToAcl('subscriptions.users', boundUsers)(args); } -Meteor.publish('users2x', publish); +Meteor.publish('users', publish); diff --git a/bigbluebutton-html5/imports/startup/client/base.jsx b/bigbluebutton-html5/imports/startup/client/base.jsx index 726012248f..3583457ace 100644 --- a/bigbluebutton-html5/imports/startup/client/base.jsx +++ b/bigbluebutton-html5/imports/startup/client/base.jsx @@ -87,8 +87,8 @@ Base.propTypes = propTypes; Base.defaultProps = defaultProps; const SUBSCRIPTIONS_NAME = [ - 'users2x', 'chat2x', 'cursor2x', 'meetings2x', 'polls2x', 'presentations2x', 'annotations', - 'slides2x', 'captions2x', 'breakouts2x', 'voiceUsers', 'whiteboard-multi-user', + 'users', 'chat', 'cursor', 'meetings', 'polls', 'presentations', 'annotations', + 'slides', 'captions', 'breakouts', 'voiceUsers', 'whiteboard-multi-user', ]; const BaseContainer = createContainer(({ params }) => { diff --git a/bigbluebutton-html5/imports/startup/server/redis.js b/bigbluebutton-html5/imports/startup/server/redis.js index 43151cb525..4e15cf962a 100644 --- a/bigbluebutton-html5/imports/startup/server/redis.js +++ b/bigbluebutton-html5/imports/startup/server/redis.js @@ -90,7 +90,7 @@ class MettingMessageQueue { } } -class RedisPubSub2x { +class RedisPubSub { static handlePublishError(err) { if (err) { @@ -189,7 +189,7 @@ class RedisPubSub2x { const envelope = makeEnvelope(channel, eventName, header, payload); - return this.pub.publish(channel, envelope, RedisPubSub2x.handlePublishError); + return this.pub.publish(channel, envelope, RedisPubSub.handlePublishError); } publishSystemMessage(channel, eventName, payload) { @@ -199,7 +199,7 @@ class RedisPubSub2x { const envelope = makeEnvelope(channel, eventName, header, payload); - return this.pub.publish(channel, envelope, RedisPubSub2x.handlePublishError); + return this.pub.publish(channel, envelope, RedisPubSub.handlePublishError); } publishMeetingMessage(channel, eventName, meetingId, payload) { @@ -210,7 +210,7 @@ class RedisPubSub2x { const envelope = makeEnvelope(channel, eventName, header, payload); - return this.pub.publish(channel, envelope, RedisPubSub2x.handlePublishError); + return this.pub.publish(channel, envelope, RedisPubSub.handlePublishError); } publishUserMessage(channel, eventName, meetingId, userId, payload) { @@ -222,11 +222,11 @@ class RedisPubSub2x { const envelope = makeEnvelope(channel, eventName, header, payload); - return this.pub.publish(channel, envelope, RedisPubSub2x.handlePublishError); + return this.pub.publish(channel, envelope, RedisPubSub.handlePublishError); } } -const RedisPubSubSingleton = new RedisPubSub2x(); +const RedisPubSubSingleton = new RedisPubSub(); Meteor.startup(() => { const REDIS_CONFIG = Meteor.settings.redis; diff --git a/bigbluebutton-html5/imports/ui/services/auth/index.js b/bigbluebutton-html5/imports/ui/services/auth/index.js index 04bfec5901..1274790f13 100644 --- a/bigbluebutton-html5/imports/ui/services/auth/index.js +++ b/bigbluebutton-html5/imports/ui/services/auth/index.js @@ -3,7 +3,7 @@ import { Tracker } from 'meteor/tracker'; import Storage from '/imports/ui/services/storage/session'; -import Users2x from '/imports/api/users'; +import Users from '/imports/api/users'; import { makeCall, logClient } from '/imports/ui/services/api'; const CONNECTION_TIMEOUT = Meteor.settings.public.app.connectionTimeout; @@ -158,7 +158,7 @@ class Auth { }); }, 5000); - const subscription = Meteor.subscribe('current-user2x', credentials); + const subscription = Meteor.subscribe('current-user', credentials); if (!subscription.ready()) return; resolve(c); @@ -187,7 +187,7 @@ class Auth { Tracker.autorun((c) => { const selector = { meetingId: this.meetingID, userId: this.userID }; - const query = Users2x.find(selector); + const query = Users.find(selector); query.observeChanges({ changed: (id, fields) => { @@ -208,7 +208,7 @@ class Auth { }); }); - makeCall('validateAuthToken2x'); + makeCall('validateAuthToken'); }); } From 51abc59bd8fe2f585036121be280d2b8bee0bedb Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 12 Oct 2017 17:07:52 -0300 Subject: [PATCH 05/37] Refactor BrowserCheck class to store browser data and call the "determineBrowser" external interface method only once. --- .../src/org/bigbluebutton/main/api/JSAPI.as | 6 -- .../main/views/AudioSelectionWindow.mxml | 8 +- .../main/views/MainApplicationShell.mxml | 18 ++-- .../phone/managers/WebRTCCallManager.as | 8 -- .../managers/ScreenshareManager.as | 2 +- .../modules/screenshare/utils/BrowserCheck.as | 51 ----------- .../utils/WebRTCScreenshareUtility.as | 1 + .../components/ScreensharePublishWindow.mxml | 2 - .../videoconf/model/VideoConfOptions.as | 6 +- .../util/browser/BrowserCheck.as | 91 +++++++++++++++++++ 10 files changed, 106 insertions(+), 87 deletions(-) delete mode 100755 bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/BrowserCheck.as create mode 100755 bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/api/JSAPI.as b/bigbluebutton-client/src/org/bigbluebutton/main/api/JSAPI.as index dd6afc395f..cb0afcc914 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/api/JSAPI.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/api/JSAPI.as @@ -44,12 +44,6 @@ package org.bigbluebutton.main.api return false; } - public function getBrowserInfo():Array { - if (ExternalInterface.available) { - return ExternalInterface.call("determineBrowser"); - } - return ["unknown", 0, 0]; - } } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml index eee6319ad3..11871eb4fc 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml @@ -44,18 +44,16 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.phone.events.JoinVoiceConferenceCommand; import org.bigbluebutton.modules.phone.events.UseFlashModeCommand; import org.bigbluebutton.modules.phone.models.PhoneOptions; + import org.bigbluebutton.util.browser.BrowserCheck; import org.bigbluebutton.util.i18n.ResourceUtil; private static const LOGGER:ILogger = getClassLogger(AudioSelectionWindow); private var phoneOptions:PhoneOptions; - private var browserInfo:Array; private function init():void { phoneOptions = Options.getOptions(PhoneOptions) as PhoneOptions; - browserInfo = JSAPI.getInstance().getBrowserInfo(); - if (!phoneOptions.listenOnlyMode) btnListenOnly.enabled = false; @@ -75,7 +73,7 @@ with BigBlueButton; if not, see . } // If Puffin browser is deteted and version is less than 4.6 - if (browserInfo[0] == "Puffin" && String(browserInfo[2]).substr(0, 3) < "4.6") { + if (BrowserCheck.isPuffinBelow46()) { vboxListen.percentWidth = 100; } } @@ -83,7 +81,7 @@ with BigBlueButton; if not, see . private function onMicClick():void { LOGGER.debug("AudioSelectionWindow - Share Microphone Clicked"); var dispatcher:Dispatcher = new Dispatcher(); - if (browserInfo[0] == "Puffin" && String(browserInfo[2]).substr(0, 3) >= "4.6") { + if (BrowserCheck.isPuffin46AndAbove()) { dispatcher.dispatchEvent(new UseFlashModeCommand()); } else { diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index f618e7a54d..f868abcf1a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -150,6 +150,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent; import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent; import org.bigbluebutton.modules.phone.models.PhoneOptions; + import org.bigbluebutton.util.browser.BrowserCheck; import org.bigbluebutton.modules.users.model.UsersOptions; import org.bigbluebutton.modules.users.views.BreakoutRoomSettings; import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent; @@ -492,21 +493,19 @@ with BigBlueButton; if not, see . private function versionCheck():void { var browserOptions : BrowserVersionsOptions = Options.getOptions(BrowserVersionsOptions) as BrowserVersionsOptions; if (!StringUtils.isEmpty(browserOptions.chrome) && !StringUtils.isEmpty(browserOptions.firefox) && !StringUtils.isEmpty(browserOptions.flash)) { - //find browser version - var browserVersion:Array = ExternalInterface.call("determineBrowser"); //check browser version - if ((browserVersion[0].toString().toLowerCase() == "chrome" && browserVersion[1] < browserOptions.chrome) || browserVersion[0].toString().toLowerCase() == "firefox" && browserVersion[1] < browserOptions.firefox) { + if ((BrowserCheck.isChrome() && BrowserCheck.browserMajorVersion < browserOptions.chrome) || BrowserCheck.isFirefox() && BrowserCheck.browserMajorVersion < browserOptions.firefox) { globalDispatcher.dispatchEvent(new ClientStatusEvent(ClientStatusEvent.WARNING_MESSAGE_EVENT, ResourceUtil.getInstance().getString("bbb.clientstatus.browser.title"), - ResourceUtil.getInstance().getString("bbb.clientstatus.browser.message", [browserVersion[0]+" "+browserVersion[1]]), + ResourceUtil.getInstance().getString("bbb.clientstatus.browser.message", [BrowserCheck.browserName+" "+BrowserCheck.browserMajorVersion]), 'bbb.clientstatus.browser.message')); } //find flash version var flashVersion:Object = getFlashVersion(); //check flash version - if ((flashVersion.os == 'LNX' && browserVersion[0].toString().toLowerCase() != "chrome" && flashVersion.major < 11) || - ((flashVersion.os != 'LNX' || browserVersion[0].toString().toLowerCase() == "chrome") && flashVersion.major < browserOptions.flash)) { + if ((flashVersion.os == 'LNX' && !BrowserCheck.isChrome() && flashVersion.major < 11) || + ((flashVersion.os != 'LNX' || BrowserCheck.isChrome()) && flashVersion.major < browserOptions.flash)) { globalDispatcher.dispatchEvent(new ClientStatusEvent(ClientStatusEvent.WARNING_MESSAGE_EVENT, ResourceUtil.getInstance().getString("bbb.clientstatus.flash.title"), ResourceUtil.getInstance().getString("bbb.clientstatus.flash.message", [flashVersion.major+"."+flashVersion.minor+"."+flashVersion.build]), @@ -629,9 +628,8 @@ with BigBlueButton; if not, see . private function handleWebRTCMediaRequestEvent(event:WebRTCMediaEvent):void { var options:PhoneOptions = new PhoneOptions(); if (!options.showMicrophoneHint) return; - var browser:String = ExternalInterface.call("determineBrowser")[0]; var browserPermissionHelper:BrowserPermissionHelper = PopUpUtil.createModalPopUp(mdiCanvas, BrowserPermissionHelper, false) as BrowserPermissionHelper; - if (browser == "Firefox") { + if (BrowserCheck.isFirefox()) { if (browserPermissionHelper) { if (Capabilities.os.indexOf("Mac") >= 0){ browserPermissionHelper.currentState = "firefoxMicMacOSX"; @@ -642,7 +640,7 @@ with BigBlueButton; if not, see . browserPermissionHelper.x = 50; browserPermissionHelper.y = 200; } - } else if (browser == "Chrome") { + } else if (BrowserCheck.isChrome()) { if (browserPermissionHelper) { browserPermissionHelper.currentState = "chromeMic"; browserPermissionHelper.x = 50; @@ -666,7 +664,7 @@ with BigBlueButton; if not, see . } private function handleShareCameraRequestEvent(event:ShareCameraRequestEvent):void { - if (ExternalInterface.call("determineBrowser")[0] == "Chrome") { + if (BrowserCheck.isChrome()) { // Show browserPermissionHelper component after showing the webcam window due event listeners registration order setTimeout(showbrowserPermissionHelper, 100); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRTCCallManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRTCCallManager.as index e21ee048af..732d640602 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRTCCallManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/WebRTCCallManager.as @@ -14,7 +14,6 @@ package org.bigbluebutton.modules.phone.managers import org.as3commons.logging.util.jsonXify; import org.bigbluebutton.core.Options; import org.bigbluebutton.core.UsersUtil; - import org.bigbluebutton.main.api.JSAPI; import org.bigbluebutton.main.events.ClientStatusEvent; import org.bigbluebutton.main.model.users.AutoReconnect; import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent; @@ -36,8 +35,6 @@ package org.bigbluebutton.modules.phone.managers private static const LOGGER:ILogger = getClassLogger(WebRTCCallManager); private const MAX_RETRIES:Number = 3; - private var browserType:String = "unknown"; - private var browserVersion:int = 0; private var dispatcher:Dispatcher = new Dispatcher(); private var echoTestDone:Boolean = false; @@ -50,11 +47,6 @@ package org.bigbluebutton.modules.phone.managers private var reconnecting:Boolean = false; public function WebRTCCallManager() { - var browserInfo:Array = JSAPI.getInstance().getBrowserInfo(); - if (browserInfo != null) { - browserType = browserInfo[0]; - browserVersion = browserInfo[1]; - } options = Options.getOptions(PhoneOptions) as PhoneOptions; // only show the warning if the admin has enabled WebRTC diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as index 3f6ce65b49..031bbe8f8f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/managers/ScreenshareManager.as @@ -36,7 +36,7 @@ package org.bigbluebutton.modules.screenshare.managers { import org.bigbluebutton.modules.screenshare.model.ScreenshareModel; import org.bigbluebutton.modules.screenshare.model.ScreenshareOptions; import org.bigbluebutton.modules.screenshare.services.ScreenshareService; - import org.bigbluebutton.modules.screenshare.utils.BrowserCheck; + import org.bigbluebutton.util.browser.BrowserCheck; public class ScreenshareManager { private static const LOGGER:ILogger = getClassLogger(ScreenshareManager); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/BrowserCheck.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/BrowserCheck.as deleted file mode 100755 index fb83f9057f..0000000000 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/BrowserCheck.as +++ /dev/null @@ -1,51 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2016 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ - -package org.bigbluebutton.modules.screenshare.utils -{ - import flash.external.ExternalInterface; - - import org.as3commons.logging.api.ILogger; - import org.as3commons.logging.api.getClassLogger; - - public class BrowserCheck { - private static const LOGGER:ILogger = getClassLogger(BrowserCheck); - - public static function isWebRTCSupported():Boolean { - /*LOGGER.debug("isWebRTCSupported - ExternalInterface.available=[{0}], isWebRTCAvailable=[{1}]", [ExternalInterface.available, ExternalInterface.call("isWebRTCAvailable")]);*/ - return (ExternalInterface.available && ExternalInterface.call("isWebRTCAvailable")); - } - - public static function isChrome():Boolean { - var browser:Array = ExternalInterface.call("determineBrowser"); - return browser[0] == "Chrome"; - } - - public static function isFirefox():Boolean { - var browser:Array = ExternalInterface.call("determineBrowser"); - return browser[0] == "Firefox"; - } - - public static function isHttps():Boolean { - var url:String = ExternalInterface.call("window.location.href.toString"); - var httpsPattern:RegExp = /^https/; - return httpsPattern.test(url); - } - } -} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/WebRTCScreenshareUtility.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/WebRTCScreenshareUtility.as index 49c52d33ba..3cafe37827 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/WebRTCScreenshareUtility.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/utils/WebRTCScreenshareUtility.as @@ -26,6 +26,7 @@ package org.bigbluebutton.modules.screenshare.utils import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.core.Options; import org.bigbluebutton.modules.screenshare.model.ScreenshareOptions; + import org.bigbluebutton.util.browser.BrowserCheck; public class WebRTCScreenshareUtility { private static const LOGGER:ILogger = getClassLogger(WebRTCScreenshareUtility); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml index 52461fc6ae..839f808a5a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml @@ -128,8 +128,6 @@ with BigBlueButton; if not, see . os = ""; } - browser = ExternalInterface.call("determineBrowser")[0]; - windowControls.maximizeRestoreBtn.enabled = false; titleBarOverlay.tabIndex = dsOptions.baseTabIndex; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as index 2df9f2f817..9fd1390157 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/model/VideoConfOptions.as @@ -18,7 +18,7 @@ */ package org.bigbluebutton.modules.videoconf.model { import org.bigbluebutton.core.Options; - import org.bigbluebutton.main.api.JSAPI; + import org.bigbluebutton.util.browser.BrowserCheck; public class VideoConfOptions extends Options { public var uri:String = "rtmp://localhost/video"; @@ -58,10 +58,8 @@ package org.bigbluebutton.modules.videoconf.model { } override protected function handleExtraData():void { - var browserInfo:Array = JSAPI.getInstance().getBrowserInfo(); - // If we are using Puffin browser - if (browserInfo[0] == "Puffin" && String(browserInfo[2]).substr(0, 3) < "4.6") { + if (BrowserCheck.isPuffinBelow46()) { showButton = false; } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as b/bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as new file mode 100755 index 0000000000..dfcc645096 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as @@ -0,0 +1,91 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2016 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +package org.bigbluebutton.util.browser { + import flash.external.ExternalInterface; + + import org.as3commons.lang.StringUtils; + import org.as3commons.logging.api.ILogger; + import org.as3commons.logging.api.getClassLogger; + + public class BrowserCheck { + private static const LOGGER:ILogger = getClassLogger(BrowserCheck); + + private static var _browserName:String; + + private static var _majorVersion:String; + + private static var _fullVersion:String; + + // The function below is called in $cinit, while the class is used for the first time. + getBrowserInfo(); + + public static function isWebRTCSupported():Boolean { + /*LOGGER.debug("isWebRTCSupported - ExternalInterface.available=[{0}], isWebRTCAvailable=[{1}]", [ExternalInterface.available, ExternalInterface.call("isWebRTCAvailable")]);*/ + return (ExternalInterface.available && ExternalInterface.call("isWebRTCAvailable")); + } + + public static function get browserName():String { + return _browserName; + } + + public static function get browserMajorVersion():String { + return _majorVersion; + } + + public static function get browserFullVersion():String { + return _fullVersion; + } + + public static function isChrome():Boolean { + return _browserName.toLowerCase() == "chrome"; + } + + public static function isFirefox():Boolean { + return _browserName.toLowerCase() == "firefox"; + } + + public static function isPuffinBelow46():Boolean { + return _browserName.toLowerCase() == "puffin" && String(_fullVersion).substr(0, 3) < "4.6"; + } + + public static function isPuffin46AndAbove():Boolean { + return browserName.toLowerCase() == "puffin" && String(_fullVersion).substr(0, 3) >= "4.6"; + } + + private static function getBrowserInfo():void { + if (ExternalInterface.available && StringUtils.isEmpty(browserName)) { + var browserInfo:Array = ExternalInterface.call("determineBrowser"); + _browserName = browserInfo[0]; + _majorVersion = String(browserInfo[1]); + _fullVersion = String(browserInfo[2]); + } else { + _browserName = "unknown"; + _majorVersion = "0"; + _fullVersion = "0"; + } + } + + public static function isHttps():Boolean { + var url:String = ExternalInterface.call("window.location.href.toString"); + var httpsPattern:RegExp = /^https/; + return httpsPattern.test(url); + } + } +} From 58f60efe4016c1115cb96342a81c59c15d2504fd Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 12 Oct 2017 18:21:20 -0300 Subject: [PATCH 06/37] Improve opera browser detection. --- bigbluebutton-client/resources/prod/lib/bbb_blinker.js | 6 ++---- .../src/org/bigbluebutton/util/browser/BrowserCheck.as | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-client/resources/prod/lib/bbb_blinker.js b/bigbluebutton-client/resources/prod/lib/bbb_blinker.js index beb32772dd..eded9d29f0 100755 --- a/bigbluebutton-client/resources/prod/lib/bbb_blinker.js +++ b/bigbluebutton-client/resources/prod/lib/bbb_blinker.js @@ -97,11 +97,9 @@ function determineBrowser() var nameOffset,verOffset,ix; // In Opera, the true version is after "Opera" or after "Version" - if ((verOffset=nAgt.indexOf("Opera"))!=-1) { + if ((verOffset=nAgt.indexOf("OPR/"))!=-1) { browserName = "Opera"; - fullVersion = nAgt.substring(verOffset+6); - if ((verOffset=nAgt.indexOf("Version"))!=-1) - fullVersion = nAgt.substring(verOffset+8); + fullVersion = nAgt.substring(verOffset+4); } // In MSIE, the true version is after "MSIE" in userAgent else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as b/bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as index dfcc645096..7325903ba6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as +++ b/bigbluebutton-client/src/org/bigbluebutton/util/browser/BrowserCheck.as @@ -57,6 +57,10 @@ package org.bigbluebutton.util.browser { return _browserName.toLowerCase() == "chrome"; } + public static function isOpera():Boolean { + return _browserName.toLowerCase() == "opera"; + } + public static function isFirefox():Boolean { return _browserName.toLowerCase() == "firefox"; } From 770947c06574aa98909f787692d8ff6b1b168a2e Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 12 Oct 2017 18:30:45 -0300 Subject: [PATCH 07/37] Show a message when accessing webcam from HTTP using chrome >= 60 or opera >= 47 --- .../locale/en_US/bbbResources.properties | 1 + .../videoconf/views/ToolbarPopupButton.mxml | 44 ++++++++++++------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index a071e467ff..9c5f4dcafa 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -369,6 +369,7 @@ bbb.video.publish.closeBtn.accessName = Close the webcam settings dialog box bbb.video.publish.closeBtn.label = Cancel bbb.video.publish.titleBar = Publish Webcam Window bbb.video.streamClose.toolTip = Close stream for: {0} +bbb.video.message.browserhttp = This server is not configured with SSL. As a result, {0} disables sharing of your webcam. bbb.screensharePublish.title = Screen Sharing: Presenter's Preview bbb.screensharePublish.pause.tooltip = Pause screen share bbb.screensharePublish.pause.label = Pause diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarPopupButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarPopupButton.mxml index bcfa0b19b9..84b20d8289 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarPopupButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/ToolbarPopupButton.mxml @@ -42,25 +42,31 @@ with BigBlueButton; if not, see . . private function openPublishWindow():void{ + if (!BrowserCheck.isHttps() && ((BrowserCheck.isChrome() && BrowserCheck.browserMajorVersion >= "60") || (BrowserCheck.isOpera() && BrowserCheck.browserMajorVersion >= "47"))) { + Alert.show(ResourceUtil.getInstance().getString("bbb.video.message.browserhttp", [BrowserCheck.browserName])); + return; + } this.enabled = false; if(_currentState == ON_STATE) { LOGGER.debug("[ToolbarPopupButton:openPublishWindow] Close window"); From 05b400267f0b8b8e03fb7322101b92dc96b761ae Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 12 Oct 2017 18:40:11 -0300 Subject: [PATCH 08/37] Directly use Flash Audio if under HTTP using chrome >= 60 or opera >= 47 --- .../main/views/AudioSelectionWindow.mxml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml index 11871eb4fc..efe6d4e6b2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml @@ -77,19 +77,18 @@ with BigBlueButton; if not, see . vboxListen.percentWidth = 100; } } - + private function onMicClick():void { LOGGER.debug("AudioSelectionWindow - Share Microphone Clicked"); var dispatcher:Dispatcher = new Dispatcher(); - if (BrowserCheck.isPuffin46AndAbove()) { - dispatcher.dispatchEvent(new UseFlashModeCommand()); - } - else { + if (BrowserCheck.isPuffin46AndAbove() || (!BrowserCheck.isHttps() && ((BrowserCheck.isChrome() && BrowserCheck.browserMajorVersion >= "60") || (BrowserCheck.isOpera() && BrowserCheck.browserMajorVersion >= "47")))) { + dispatcher.dispatchEvent(new UseFlashModeCommand()); + } else { var command:JoinVoiceConferenceCommand = new JoinVoiceConferenceCommand(); command.mic = true; dispatcher.dispatchEvent(command); } - + PopUpUtil.removePopUp(this); } From 680a53859611c6efb1f91c18c1c2555f8769393e Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 12 Oct 2017 14:41:12 -0700 Subject: [PATCH 09/37] - do not set listenOnly status when receiving user joined voice event from FS as HTML5 client connects with no mic --- .../apps/users/UserConnectedToGlobalAudioMsgHdlr.scala | 10 ++++++++-- .../apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala index 0e9108e9b2..67ee4b65b0 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala @@ -29,8 +29,14 @@ trait UserConnectedToGlobalAudioMsgHdlr { for { user <- Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId) } yield { - val vu = VoiceUserState(intId = user.intId, voiceUserId = user.intId, callingWith = "flash", callerName = user.name, - callerNum = user.name, muted = true, talking = false, listenOnly = true) + + val vu = VoiceUsers.findWIthIntId(liveMeeting.voiceUsers, user.intId) match { + case Some(vus) => VoiceUserState(intId = user.intId, voiceUserId = vus.voiceUserId, callingWith = "flash", callerName = user.name, + callerNum = user.name, muted = true, talking = false, listenOnly = true) + case None => VoiceUserState(intId = user.intId, voiceUserId = user.intId, callingWith = "flash", callerName = user.name, + callerNum = user.name, muted = true, talking = false, listenOnly = true) + } + VoiceUsers.add(liveMeeting.voiceUsers, vu) broadcastEvent(vu) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala index 5fde42e711..01e3f2fa8a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala @@ -41,7 +41,10 @@ trait UserJoinedVoiceConfEvtMsgHdlr extends BreakoutHdlrHelpers { outGW.send(msgEvent) } - val voiceUserState = VoiceUserState(intId, voiceUserId, callingWith, callerIdName, callerIdNum, muted, talking, listenOnly = false) + val voiceUserState = VoiceUsers.findWIthIntId(liveMeeting.voiceUsers, intId) match { + case Some(vus) => VoiceUserState(intId, voiceUserId, callingWith, callerIdName, callerIdNum, muted, talking, listenOnly = vus.listenOnly) + case None => VoiceUserState(intId, voiceUserId, callingWith, callerIdName, callerIdNum, muted, talking, listenOnly = false) + } VoiceUsers.add(liveMeeting.voiceUsers, voiceUserState) From 73493f1345a3b1b6b6efce481049c9a3d95ae789 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 12 Oct 2017 15:33:22 -0700 Subject: [PATCH 10/37] - change how we handle listen only for html5 user --- .../apps/users/UserConnectedToGlobalAudioMsgHdlr.scala | 9 ++------- .../core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala | 6 ++---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala index 67ee4b65b0..ffe13b6b9d 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserConnectedToGlobalAudioMsgHdlr.scala @@ -30,13 +30,8 @@ trait UserConnectedToGlobalAudioMsgHdlr { user <- Users2x.findWithIntId(liveMeeting.users2x, msg.body.userId) } yield { - val vu = VoiceUsers.findWIthIntId(liveMeeting.voiceUsers, user.intId) match { - case Some(vus) => VoiceUserState(intId = user.intId, voiceUserId = vus.voiceUserId, callingWith = "flash", callerName = user.name, - callerNum = user.name, muted = true, talking = false, listenOnly = true) - case None => VoiceUserState(intId = user.intId, voiceUserId = user.intId, callingWith = "flash", callerName = user.name, - callerNum = user.name, muted = true, talking = false, listenOnly = true) - } - + val vu = VoiceUserState(intId = user.intId, voiceUserId = user.intId, callingWith = "flash", callerName = user.name, + callerNum = user.name, muted = true, talking = false, listenOnly = true) VoiceUsers.add(liveMeeting.voiceUsers, vu) broadcastEvent(vu) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala index 01e3f2fa8a..15e35a59bf 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/UserJoinedVoiceConfEvtMsgHdlr.scala @@ -41,11 +41,9 @@ trait UserJoinedVoiceConfEvtMsgHdlr extends BreakoutHdlrHelpers { outGW.send(msgEvent) } - val voiceUserState = VoiceUsers.findWIthIntId(liveMeeting.voiceUsers, intId) match { - case Some(vus) => VoiceUserState(intId, voiceUserId, callingWith, callerIdName, callerIdNum, muted, talking, listenOnly = vus.listenOnly) - case None => VoiceUserState(intId, voiceUserId, callingWith, callerIdName, callerIdNum, muted, talking, listenOnly = false) - } + val isListenOnly = if (callerIdName.startsWith("LISTENONLY")) true else false + val voiceUserState = VoiceUserState(intId, voiceUserId, callingWith, callerIdName, callerIdNum, muted, talking, listenOnly = isListenOnly) VoiceUsers.add(liveMeeting.voiceUsers, voiceUserState) broadcastEvent(voiceUserState) From 11c7287d26c91a5c3d7e00a5c3286a7b366590a3 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 12 Oct 2017 15:36:19 -0700 Subject: [PATCH 11/37] - don't force changing listen only status on mute and talking events --- .../main/scala/org/bigbluebutton/core/models/VoiceUsers.scala | 4 ---- 1 file changed, 4 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala index 45be254330..f9f11212f1 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/VoiceUsers.scala @@ -37,7 +37,6 @@ object VoiceUsers { } yield { val vu = u.modify(_.muted).setTo(muted) .modify(_.talking).setTo(false) - .modify(_.listenOnly).setTo(false) users.save(vu) vu } @@ -49,7 +48,6 @@ object VoiceUsers { } yield { val vu = u.modify(_.muted).setTo(false) .modify(_.talking).setTo(talkng) - .modify(_.listenOnly).setTo(false) users.save(vu) vu } @@ -61,7 +59,6 @@ object VoiceUsers { } yield { val vu = u.modify(_.muted).setTo(true) .modify(_.talking).setTo(false) - .modify(_.listenOnly).setTo(true) users.save(vu) vu } @@ -73,7 +70,6 @@ object VoiceUsers { } yield { val vu = u.modify(_.muted).setTo(false) .modify(_.talking).setTo(false) - .modify(_.listenOnly).setTo(false) users.save(vu) vu } From 8b8456a1ac70bc6bc26614c681f02a0dd9f053cf Mon Sep 17 00:00:00 2001 From: Joao Siebel Date: Thu, 12 Oct 2017 18:05:37 -0300 Subject: [PATCH 12/37] Closes breakout room modal when the breakout room are closed --- .../imports/ui/components/nav-bar/component.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx b/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx index a312d765e0..fe237918b0 100644 --- a/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx @@ -45,6 +45,9 @@ const openBreakoutJoinConfirmation = (breakoutURL, breakoutName, mountModal) => breakoutName={breakoutName} />); +const closeBreakoutJoinConfirmation = (mountModal) => + mountModal(null); + class NavBar extends Component { constructor(props) { super(props); @@ -143,13 +146,20 @@ class NavBar extends Component { ); } - componentDidUpdate() { + componentDidUpdate(oldProps) { const { breakouts, getBreakoutJoinURL, isBreakoutRoom, } = this.props; + const hadBreakouts = oldProps.breakouts.length; + const hasBreakouts = breakouts.length; + + if(!hasBreakouts && hadBreakouts) { + closeBreakoutJoinConfirmation(this.props.mountModal); + } + breakouts.forEach((breakout) => { if (!breakout.users) { return; From 7449f1555e3dde92058a344fca895a15a1e02f92 Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 12 Oct 2017 20:14:14 -0300 Subject: [PATCH 13/37] Fix toolbar top paddingTop style. --- bigbluebutton-client/branding/default/style/css/V2Theme.css | 5 +++-- bigbluebutton-client/locale/en_US/bbbResources.properties | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bigbluebutton-client/branding/default/style/css/V2Theme.css b/bigbluebutton-client/branding/default/style/css/V2Theme.css index 0c6e0511b4..d749dbea32 100755 --- a/bigbluebutton-client/branding/default/style/css/V2Theme.css +++ b/bigbluebutton-client/branding/default/style/css/V2Theme.css @@ -143,7 +143,7 @@ phonecomponents|MuteMeButton { .toolbarMainBox { backgroundColor : #FFFFFF; - paddingTop : 6; + paddingTop : 0; paddingBottom : 6; } @@ -156,7 +156,7 @@ phonecomponents|MuteMeButton { } .topBoxStyle { - paddingTop : 0; + paddingTop : 6; paddingBottom : 0; paddingLeft : 8; paddingRight : 8; @@ -911,6 +911,7 @@ views|LockSettings { */ views|MainApplicationShell { + borderStyle : none; paddingBottom : 0; verticalGap : 0; } diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index a071e467ff..7d04ae1ca2 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -246,7 +246,7 @@ bbb.presentation.fitToWidth.toolTip = Fit Presentation To Width bbb.presentation.fitToPage.toolTip = Fit Presentation To Page bbb.presentation.uploadPresBtn.toolTip = Upload Presentation bbb.presentation.downloadPresBtn.toolTip = Download Presentations -bbb.presentation.poll.response = Response to poll +bbb.presentation.poll.response = Respond to poll bbb.presentation.backBtn.toolTip = Previous slide bbb.presentation.btnSlideNum.accessibilityName = Slide {0} of {1} bbb.presentation.btnSlideNum.toolTip = Select a slide From b3572cec3a16a975a5a4fc01b0e4759cf2d80012 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhurbenko Date: Thu, 12 Oct 2017 17:20:27 -0700 Subject: [PATCH 14/37] Changed the way the object is assigned --- .../imports/ui/components/dropdown/trigger/component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx b/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx index 65bd7dd548..9c15694103 100644 --- a/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/dropdown/trigger/component.jsx @@ -41,7 +41,7 @@ export default class DropdownTrigger extends Component { } render() { - const remainingProps = Object.assign({}, this.props); + const remainingProps = { ...this.props }; delete remainingProps.dropdownToggle; delete remainingProps.dropdownShow; delete remainingProps.dropdownHide; From cbe9ca666a941c42ba2cc972a58a3d7fbb5ab646 Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Fri, 13 Oct 2017 11:40:24 -0300 Subject: [PATCH 15/37] Add new skins for the NumericStepper component to make the UI consistent. --- .../branding/default/style/css/V2Theme.css | 31 +++- .../css/org/bigbluebutton/skins/ButtonSkin.as | 18 -- .../skins/NumericStepperDownSkin.as | 166 ++++++++++++++++++ .../skins/NumericStepperUpSkin.as | 165 +++++++++++++++++ .../css/org/bigbluebutton/skins/TabSkin.as | 13 +- 5 files changed, 362 insertions(+), 31 deletions(-) create mode 100644 bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperDownSkin.as create mode 100644 bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperUpSkin.as diff --git a/bigbluebutton-client/branding/default/style/css/V2Theme.css b/bigbluebutton-client/branding/default/style/css/V2Theme.css index d749dbea32..2ed441c7a0 100755 --- a/bigbluebutton-client/branding/default/style/css/V2Theme.css +++ b/bigbluebutton-client/branding/default/style/css/V2Theme.css @@ -429,7 +429,7 @@ mx|Button { borderAlphaUp : 1; borderAlphaOver : 1; borderAlphaDown : 1; - borderAlphaDisabled : 1; + borderAlphaDisabled : 0.25; borderThickness : 1; @@ -1064,6 +1064,35 @@ views|NetworkStatsWindow { iconRefresh : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Refresh"); } +/* +//------------------------------ +// NumericStepper +//------------------------------ +*/ + +mx|NumericStepper { + /* Normal state */ + fillColorUp : #FFFFFF; + fillColorOver : #CDD4DB; + fillColorDown : #ACB2B7; + fillColorDisabled : #F0F2F6; + borderColorUp : #CDD4DB; + borderColorOver : #1070D7; + borderColorDown : #0A5EAC; + borderColorDisabled : #CDD4DB; + + /* Icon states */ + iconColor : #4E5A66; + iconColorOver : #1070D7; + iconColorDown : #4E5A66; + + borderThickness : 1; + + /* Skins */ + downArrowSkin : ClassReference("org.bigbluebutton.skins.NumericStepperDownSkin"); + upArrowSkin : ClassReference("org.bigbluebutton.skins.NumericStepperUpSkin"); +} + /* //------------------------------ // PopUpButton diff --git a/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/ButtonSkin.as b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/ButtonSkin.as index 17869687a4..2449dea7b3 100644 --- a/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/ButtonSkin.as +++ b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/ButtonSkin.as @@ -22,24 +22,6 @@ package org.bigbluebutton.skins { public class ButtonSkin extends Border { - //-------------------------------------------------------------------------- - // - // Constructor - // - //-------------------------------------------------------------------------- - - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function ButtonSkin() { - super(); - } - //-------------------------------------------------------------------------- // // Overridden properties diff --git a/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperDownSkin.as b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperDownSkin.as new file mode 100644 index 0000000000..6b0456bb1a --- /dev/null +++ b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperDownSkin.as @@ -0,0 +1,166 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// + +package org.bigbluebutton.skins { + import flash.display.Graphics; + + import mx.skins.Border; + + public class NumericStepperDownSkin extends Border { + + //-------------------------------------------------------------------------- + // + // Overridden properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // measuredWidth + //---------------------------------- + + /** + * @private + */ + override public function get measuredWidth():Number { + return 19; + } + + //---------------------------------- + // measuredHeight + //---------------------------------- + + /** + * @private + */ + override public function get measuredHeight():Number { + return 11; + } + + //-------------------------------------------------------------------------- + // + // Overridden methods + // + //-------------------------------------------------------------------------- + + /** + * @private + */ + override protected function updateDisplayList(w:Number, h:Number):void { + super.updateDisplayList(w, h); + + var borderColorUp:uint = getStyle("borderColorUp"); + var borderColorOver:uint = getStyle("borderColorOver"); + var borderColorDown:uint = getStyle("borderColorDown"); + var borderColorDisabled:uint = getStyle("borderColorDisabled"); + + var borderThickness:uint = getStyle("borderThickness"); + + var fillColorUp:uint = getStyle("fillColorUp"); + var fillColorOver:uint = getStyle("fillColorOver"); + var fillColorDown:uint = getStyle("fillColorDown"); + var fillColorDisabled:uint = getStyle("fillColorDisabled"); + + // User-defined styles. + var arrowColor:uint = getStyle("iconColor"); + var arrowColorOver:uint = getStyle("iconColorOver"); + var arrowColorDown:uint = getStyle("iconColorDown"); + + var cornerRadius:Number = getStyle("cornerRadius"); + + var cr:Object = {tl: 0, tr: 0, bl: 0, br: cornerRadius}; + var cr1:Object = {tl: 0, tr: 0, bl: 0, br: Math.max(cornerRadius - 1, 0)}; + + // Draw the background and border. + var g:Graphics = graphics; + + g.clear(); + + switch (name) { + case "downArrowUpSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorUp, 1, null, null, null, {x: 1, y: 0, w: w - 2, h: h - 1, r: cr1}); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorUp, 1); + + break; + } + + case "downArrowOverSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorOver, 1, null, null, null, {x: 1, y: 0, w: w - 2, h: h - 1, r: cr1}); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorOver, 1, null); + + break; + } + + case "downArrowDownSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorDown, 1); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorDown, 1); + + break; + } + + case "downArrowDisabledSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorDisabled, 0.5, null, null, null, {x: 1, y: 0, w: w - 2, h: h - 1, r: cr1}); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorDisabled, 0.5, null); + + arrowColor = getStyle("disabledIconColor"); + break; + } + } + + // Draw the arrow. + g.beginFill(arrowColor); + g.moveTo(w / 2, h / 2 + 1.5); + g.lineTo(w / 2 - 3.5, h / 2 - 2.5); + g.lineTo(w / 2 + 3.5, h / 2 - 2.5); + g.lineTo(w / 2, h / 2 + 1.5); + g.endFill(); + } + } +} + diff --git a/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperUpSkin.as b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperUpSkin.as new file mode 100644 index 0000000000..26f2938c3d --- /dev/null +++ b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/NumericStepperUpSkin.as @@ -0,0 +1,165 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ + +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// + +package org.bigbluebutton.skins { + import flash.display.Graphics; + + import mx.skins.Border; + + public class NumericStepperUpSkin extends Border { + + //-------------------------------------------------------------------------- + // + // Overridden properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // measuredWidth + //---------------------------------- + + /** + * @private + */ + override public function get measuredWidth():Number { + return 19; + } + + //---------------------------------- + // measuredHeight + //---------------------------------- + + /** + * @private + */ + override public function get measuredHeight():Number { + return 11; + } + + //-------------------------------------------------------------------------- + // + // Overridden methods + // + //-------------------------------------------------------------------------- + + /** + * @private + */ + override protected function updateDisplayList(w:Number, h:Number):void { + super.updateDisplayList(w, h); + + var borderColorUp:uint = getStyle("borderColorUp"); + var borderColorOver:uint = getStyle("borderColorOver"); + var borderColorDown:uint = getStyle("borderColorDown"); + var borderColorDisabled:uint = getStyle("borderColorDisabled"); + + var borderThickness:uint = getStyle("borderThickness"); + + var fillColorUp:uint = getStyle("fillColorUp"); + var fillColorOver:uint = getStyle("fillColorOver"); + var fillColorDown:uint = getStyle("fillColorDown"); + var fillColorDisabled:uint = getStyle("fillColorDisabled"); + + // User-defined styles. + var arrowColor:uint = getStyle("iconColor"); + var arrowColorOver:uint = getStyle("iconColorOver"); + var arrowColorDown:uint = getStyle("iconColorDown"); + + var cornerRadius:Number = getStyle("cornerRadius"); + + var cr:Object = {tl: 0, tr: cornerRadius, bl: 0, br: 0}; + var cr1:Object = {tl: 0, tr: Math.max(cornerRadius - 1, 0), bl: 0, br: 0}; + + // Draw the background and border. + var g:Graphics = graphics; + + g.clear(); + + switch (name) { + case "upArrowUpSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorUp, 1, null, null, null, {x: 1, y: 1, w: w - 2, h: h - 2, r: cr1}); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorUp, 1); + + break; + } + + case "upArrowOverSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorOver, 1, null, null, null, {x: 1, y: 1, w: w - 2, h: h - 2, r: cr1}); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorOver, 1, null); + + break; + } + + case "upArrowDownSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorDown, 1); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorDown, 1); + + break; + } + + case "upArrowDisabledSkin": { + // border + drawRoundRect(0, 0, w, h, cr, borderColorDisabled, 0.5, null, null, null, {x: 1, y: 1, w: w - 2, h: h - 2, r: cr1}); + + // button fill + drawRoundRect(borderThickness, borderThickness, w - (borderThickness * 2), h - (borderThickness * 2), cr1, fillColorDisabled, 0.5, null); + + arrowColor = getStyle("disabledIconColor"); + break; + } + } + + // Draw the arrow. + g.beginFill(arrowColor); + g.moveTo(w / 2, h / 2 - 2.5); + g.lineTo(w / 2 - 3.5, h / 2 + 1.5); + g.lineTo(w / 2 + 3.5, h / 2 + 1.5); + g.lineTo(w / 2, h / 2 - 2.5); + g.endFill(); + } + } +} diff --git a/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/TabSkin.as b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/TabSkin.as index d98beece30..4393939c03 100644 --- a/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/TabSkin.as +++ b/bigbluebutton-client/branding/default/style/css/org/bigbluebutton/skins/TabSkin.as @@ -40,7 +40,7 @@ package org.bigbluebutton.skins { import flash.display.DisplayObjectContainer; import flash.utils.describeType; import flash.utils.getQualifiedClassName; - + import mx.core.EdgeMetrics; import mx.core.UIComponent; import mx.skins.Border; @@ -48,17 +48,6 @@ package org.bigbluebutton.skins { public class TabSkin extends Border { - //-------------------------------------------------------------------------- - // - // Class variables - // - //-------------------------------------------------------------------------- - - /** - * @private - */ - private static var cache:Object = {}; - //-------------------------------------------------------------------------- // // Overridden properties From b77be1a9f4ff8e0000e7540caf54e75ec6c9aaac Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Fri, 13 Oct 2017 11:37:41 -0700 Subject: [PATCH 16/37] fix user avatar image sizing --- .../bigbluebutton/modules/videoconf/views/UserAvatar.as | 7 ++++++- .../bigbluebutton/modules/videoconf/views/UserGraphic.as | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserAvatar.as diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserAvatar.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserAvatar.as old mode 100644 new mode 100755 index 65a6aa23e3..e86c44b7f6 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserAvatar.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserAvatar.as @@ -3,6 +3,8 @@ package org.bigbluebutton.modules.videoconf.views import flash.display.Loader; import flash.events.Event; import flash.net.URLRequest; + + import mx.core.UIComponent; public class UserAvatar extends UserGraphic { @@ -18,14 +20,17 @@ package org.bigbluebutton.modules.videoconf.views _completed = false; _imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete); - addChild(_imageLoader); + var request:URLRequest = new URLRequest(avatarUrl); _imageLoader.load(request); } private function onLoadingComplete(event:Event):void { _completed = true; + addChild(_imageLoader); setOriginalDimensions(_imageLoader.width, _imageLoader.height); + if (parent && parent is UIComponent) + UIComponent(parent).invalidateDisplayList(); } override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserGraphic.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserGraphic.as index 494db394b7..f81e95db79 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserGraphic.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/views/UserGraphic.as @@ -62,12 +62,12 @@ package org.bigbluebutton.modules.videoconf.views object_height = unscaledHeight; object_width = Math.ceil(unscaledHeight * aspectRatio); object_y = BORDER_THICKNESS; - object_x = Math.floor((unscaledWidth - object.width) / 2); + object_x = Math.floor((unscaledWidth - object_width) / 2); } else { object_width = unscaledWidth; object_height = Math.ceil(unscaledWidth / aspectRatio); object_x = BORDER_THICKNESS; - object_y = Math.floor((unscaledHeight - object.height) / 2); + object_y = Math.floor((unscaledHeight - object_height) / 2); } object.x = object_x; From c693215cab2f22695fd17a31728fe9fb2c98773c Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Fri, 13 Oct 2017 18:12:43 -0300 Subject: [PATCH 17/37] Remove scrollbar from AddChatTabBox component. --- .../org/bigbluebutton/modules/chat/views/AddChatTabBox.mxml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/AddChatTabBox.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/AddChatTabBox.mxml index 7887fc9f9e..70155be043 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/AddChatTabBox.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/AddChatTabBox.mxml @@ -199,7 +199,7 @@ with BigBlueButton; if not, see . - . keyDown="onUserListKeyDown(event)" toolTip="{ResourceUtil.getInstance().getString('bbb.chat.usersList.toolTip')}" accessibilityName="{ResourceUtil.getInstance().getString('bbb.chat.usersList.accessibilityName')}"/> - + Date: Fri, 13 Oct 2017 18:13:33 -0300 Subject: [PATCH 18/37] Redesign CustomLayoutNameWindow window. --- .../layout/views/CustomLayoutNameWindow.mxml | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/CustomLayoutNameWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/CustomLayoutNameWindow.mxml index 0a76cea90c..fb9c778726 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/CustomLayoutNameWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/CustomLayoutNameWindow.mxml @@ -22,14 +22,15 @@ with BigBlueButton; if not, see . + width="280"> @@ -37,13 +38,17 @@ with BigBlueButton; if not, see . . savingForFileDownload = false; } } else { - trace("The name is already in use, waiting for overwrite command or rename"); + LOGGER.debug("The name is already in use, waiting for overwrite command or rename"); } } @@ -79,8 +84,23 @@ with BigBlueButton; if not, see . ]]> - - - - + + + + + + + + From f72d165fa94794a6c1e0a5d481dba18e5792e903 Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Fri, 13 Oct 2017 18:14:50 -0300 Subject: [PATCH 19/37] Make most of the popup windows closable using keayboard ESCAPE button. --- .../branding/default/style/css/V2Theme.css | 6 +- .../locale/en_US/bbbResources.properties | 3 + .../bigbluebutton/common/IKeyboardClose.as | 26 ++++ .../src/org/bigbluebutton/core/PopUpUtil.as | 132 ++++++++++-------- .../main/views/AudioSelectionWindow.mxml | 5 +- .../bigbluebutton/main/views/BBBSettings.mxml | 3 + .../main/views/CameraDisplaySettings.mxml | 6 +- .../main/views/ClientStatusWindow.mxml | 6 +- .../main/views/FlashMicSettings.mxml | 6 +- .../bigbluebutton/main/views/GuestWindow.mxml | 1 - .../main/views/LockSettings.mxml | 7 +- .../main/views/LogoutWindow.mxml | 1 + .../main/views/MainApplicationShell.mxml | 4 +- .../bigbluebutton/main/views/MainToolbar.mxml | 9 +- .../main/views/WebRTCEchoTest.mxml | 3 +- .../modules/layout/managers/LayoutManager.as | 5 +- .../modules/layout/views/AddButton.mxml | 6 +- .../polling/views/PollChoicesModal.mxml | 6 +- .../present/ui/views/FileDownloadWindow.mxml | 8 ++ .../views/SharedNotesNameWindow.mxml | 9 +- .../sharednotes/views/SharedNotesWindow.mxml | 6 +- .../users/views/BreakoutRoomSettings.mxml | 3 +- .../users/views/JoinBreakoutRoomWindow.mxml | 2 + .../modules/users/views/UsersWindow.mxml | 2 +- 24 files changed, 160 insertions(+), 105 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/common/IKeyboardClose.as diff --git a/bigbluebutton-client/branding/default/style/css/V2Theme.css b/bigbluebutton-client/branding/default/style/css/V2Theme.css index 2ed441c7a0..e88c63ec1e 100755 --- a/bigbluebutton-client/branding/default/style/css/V2Theme.css +++ b/bigbluebutton-client/branding/default/style/css/V2Theme.css @@ -546,6 +546,10 @@ views|BrowserPermissionHelper { //------------------------------ */ +views|ClientStatusWindow { + horizontalAlign : right; +} + views|ClientStatusItemRenderer { iconSuccess : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Success"); iconWarning : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Warning"); @@ -636,7 +640,7 @@ chat|AddChatTabBox { } .chatOptionsLabel { - fontSize : 14; + fontSize : 14; } .chatMessageListStyle { diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index 7d04ae1ca2..03af64ece7 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -448,6 +448,7 @@ bbb.toolbar.deskshare.toolTip.stop = Stop Sharing Your Screen bbb.toolbar.sharednotes.toolTip = Open Shared Notes bbb.toolbar.video.toolTip.start = Share Your Webcam bbb.toolbar.video.toolTip.stop = Stop Sharing Your Webcam +bbb.layout.addButton.label = Add bbb.layout.addButton.toolTip = Add the custom layout to the list bbb.layout.overwriteLayoutName.title = Overwrite layout bbb.layout.overwriteLayoutName.text = Name already in use. Do you want to overwrite? @@ -461,6 +462,8 @@ bbb.layout.combo.custom = * Custom layout bbb.layout.combo.customName = Custom layout bbb.layout.combo.remote = Remote bbb.layout.window.name = Layout name +bbb.layout.window.close.tooltip = Close +bbb.layout.window.close.accessibilityName = Close add new layout window bbb.layout.save.complete = Layouts were successfully saved bbb.layout.save.ioerror = Layouts were not saved. Try saving again. bbb.layout.load.complete = Layouts were successfully loaded diff --git a/bigbluebutton-client/src/org/bigbluebutton/common/IKeyboardClose.as b/bigbluebutton-client/src/org/bigbluebutton/common/IKeyboardClose.as new file mode 100644 index 0000000000..56fc919a23 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/common/IKeyboardClose.as @@ -0,0 +1,26 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ +package org.bigbluebutton.common { + + /** + * Add it to popup classes to add the Keyboard.ESCAPE close behaviour + */ + public interface IKeyboardClose { + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/PopUpUtil.as b/bigbluebutton-client/src/org/bigbluebutton/core/PopUpUtil.as index d500bd937b..af268ec346 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/core/PopUpUtil.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/PopUpUtil.as @@ -17,76 +17,90 @@ * */ package org.bigbluebutton.core { - import flash.display.DisplayObject; - import flash.utils.Dictionary; - import flash.utils.getQualifiedClassName; + import flash.display.DisplayObject; + import flash.events.KeyboardEvent; + import flash.ui.Keyboard; + import flash.utils.Dictionary; + import flash.utils.getQualifiedClassName; - import mx.core.FlexGlobals; - import mx.core.IChildList; - import mx.core.IFlexDisplayObject; - import mx.core.IUIComponent; - import mx.managers.PopUpManager; - import mx.managers.SystemManager; + import mx.core.FlexGlobals; + import mx.core.IChildList; + import mx.core.IFlexDisplayObject; + import mx.core.IUIComponent; + import mx.managers.PopUpManager; + import mx.managers.SystemManager; - import org.as3commons.logging.api.ILogger; - import org.as3commons.logging.api.getClassLogger; + import org.as3commons.logging.api.ILogger; + import org.as3commons.logging.api.getClassLogger; + import org.bigbluebutton.common.IKeyboardClose; - public final class PopUpUtil { + public final class PopUpUtil { - private static const LOGGER:ILogger = getClassLogger(PopUpUtil); + private static const LOGGER:ILogger = getClassLogger(PopUpUtil); - private static var popUpDict:Dictionary = new Dictionary(true); + private static var popUpDict:Dictionary = new Dictionary(true); - public static function createNonModelPopUp(parent:DisplayObject, className:Class, center:Boolean = true):IFlexDisplayObject { - if (!checkPopUpExists(className)) { - return addPopUpToStage(parent, className, false, center); - } - return null; - } + public static function createNonModalPopUp(parent:DisplayObject, className:Class, center:Boolean = true):IFlexDisplayObject { + if (!checkPopUpExists(className)) { + return addPopUpToStage(parent, className, false, center); + } + return null; + } - public static function createModalPopUp(parent:DisplayObject, className:Class, center:Boolean = true):IFlexDisplayObject { - if (!checkPopUpExists(className)) { - return addPopUpToStage(parent, className, true, center); - } - return null; - } + public static function createModalPopUp(parent:DisplayObject, className:Class, center:Boolean = true):IFlexDisplayObject { + if (!checkPopUpExists(className)) { + return addPopUpToStage(parent, className, true, center); + } + return null; + } - public static function removePopUp(classOrInstance:*):void { - var fqcn:String = getQualifiedClassName(classOrInstance); - if (popUpDict[fqcn] != undefined) { - PopUpManager.removePopUp(popUpDict[fqcn]) - delete popUpDict[fqcn]; - LOGGER.debug("Removed PopUp with type [{0}]", [fqcn]); - } - } + public static function removePopUp(classOrInstance:*):void { + var fqcn:String = getQualifiedClassName(classOrInstance); + if (popUpDict[fqcn] != undefined) { + PopUpManager.removePopUp(popUpDict[fqcn]) + delete popUpDict[fqcn]; + LOGGER.debug("Removed PopUp with type [{0}]", [fqcn]); + } + } - private static function checkPopUpExists(className:Class):Boolean { - LOGGER.debug("Checking if [{0}] exists as a PopUp", [className]); - var systemManager:SystemManager = FlexGlobals.topLevelApplication.systemManager; + private static function checkPopUpExists(className:Class):Boolean { + LOGGER.debug("Checking if [{0}] exists as a PopUp", [className]); + var systemManager:SystemManager = FlexGlobals.topLevelApplication.systemManager; - var childList:IChildList = systemManager.rawChildren; - for (var i:int = childList.numChildren - 1; i >= 0; i--) { - var childObject:IUIComponent = childList.getChildAt(i) as IUIComponent; - // PopUp already exists - if (childObject is className && childObject.isPopUp) { - LOGGER.debug("PopUp with type [{0}] found", [className]); - return true; - } - } - LOGGER.debug("No PopUp with type [{0}] not found", [className]); - return false; - } + var childList:IChildList = systemManager.rawChildren; + for (var i:int = childList.numChildren - 1; i >= 0; i--) { + var childObject:IUIComponent = childList.getChildAt(i) as IUIComponent; + // PopUp already exists + if (childObject is className && childObject.isPopUp) { + LOGGER.debug("PopUp with type [{0}] found", [className]); + return true; + } + } + LOGGER.debug("No PopUp with type [{0}] not found", [className]); + return false; + } - private static function addPopUpToStage(parent:DisplayObject, className:Class, modal:Boolean = false, center:Boolean = true):IFlexDisplayObject { - var popUp:IFlexDisplayObject = PopUpManager.createPopUp(parent, className, modal); - if (center) { - PopUpManager.centerPopUp(popUp) - } - popUpDict[getQualifiedClassName(className)] = popUp; + private static function addPopUpToStage(parent:DisplayObject, className:Class, modal:Boolean = false, center:Boolean = true):IFlexDisplayObject { + var popUp:IFlexDisplayObject = PopUpManager.createPopUp(parent, className, modal); + if (center) { + PopUpManager.centerPopUp(popUp) + } + popUpDict[getQualifiedClassName(className)] = popUp; - LOGGER.debug("Created PopUp with type [{0}]", [className]); + if (popUp is IKeyboardClose) { + popUp.addEventListener(KeyboardEvent.KEY_DOWN, escapeKeyDownHandler); + } - return popUp; - } - } + LOGGER.debug("Created PopUp with type [{0}]", [className]); + + return popUp; + } + + private static function escapeKeyDownHandler(event:KeyboardEvent):void { + if (event.charCode == Keyboard.ESCAPE) { + event.currentTarget.removeEventListener(KeyboardEvent.KEY_DOWN, escapeKeyDownHandler); + removePopUp(event.currentTarget); + } + } + } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml index eee6319ad3..d3f63c6f6d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/AudioSelectionWindow.mxml @@ -23,9 +23,10 @@ with BigBlueButton; if not, see . xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mate="http://mate.asfusion.com/" xmlns:common="org.bigbluebutton.common.*" + implements="org.bigbluebutton.common.IKeyboardClose" + show="this.setFocus()" initialize="init()" layout="absolute" - close="onCancelClicked()" verticalScrollPolicy="off" horizontalScrollPolicy="off" showCloseButton="false"> @@ -106,7 +107,7 @@ with BigBlueButton; if not, see . } private function onCancelClicked():void { - LOGGER.debug("AudioSelectionWindow - Cancel clicked"); + LOGGER.debug("AudioSelectionWindow - Close clicked"); var dispatcher:Dispatcher = new Dispatcher(); dispatcher.dispatchEvent(new AudioSelectionWindowEvent(AudioSelectionWindowEvent.CLOSED_AUDIO_SELECTION)); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/BBBSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/BBBSettings.mxml index ef9fc85597..84c386eac9 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/BBBSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/BBBSettings.mxml @@ -3,6 +3,8 @@ xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:common="org.bigbluebutton.common.*" xmlns:mate="http://mate.asfusion.com/" + implements="org.bigbluebutton.common.IKeyboardClose" + show="this.setFocus()" layout="vertical" horizontalAlign="center" showCloseButton="false" @@ -14,6 +16,7 @@ import mx.core.UIComponent; import mx.managers.PopUpManager; + import org.bigbluebutton.common.IKeyboardClose; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.util.i18n.ResourceUtil; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/CameraDisplaySettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/CameraDisplaySettings.mxml index 3aaea09d0c..5391b2262d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/CameraDisplaySettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/CameraDisplaySettings.mxml @@ -25,7 +25,7 @@ with BigBlueButton; if not, see . layout="absolute" verticalScrollPolicy="off" horizontalScrollPolicy="off" width="630" height="450" creationComplete="onCreationComplete()" styleName="cameraDisplaySettingsWindowStyle" - showCloseButton="false" close="onCancelClicked()" keyDown="handleKeyDown(event)"> + showCloseButton="false" keyDown="handleKeyDown(event)"> . import mx.collections.ArrayCollection; import mx.collections.ArrayList; - import mx.events.CloseEvent; import org.bigbluebutton.common.Media; import org.bigbluebutton.core.BBB; @@ -188,8 +187,7 @@ with BigBlueButton; if not, see . private function handleKeyDown(event:KeyboardEvent):void { if (event.charCode == Keyboard.ESCAPE) { - disableCamera(); - this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE)); + onCancelClicked(); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/ClientStatusWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/ClientStatusWindow.mxml index f58613d45a..4904357c7e 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/ClientStatusWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/ClientStatusWindow.mxml @@ -23,12 +23,14 @@ with BigBlueButton; if not, see . xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:chat="org.bigbluebutton.modules.chat.views.*" width="500" height="400" + implements="org.bigbluebutton.common.IKeyboardClose" + show="this.setFocus()" horizontalScrollPolicy="off" title="{ResourceUtil.getInstance().getString('bbb.clientstatus.title')}" - horizontalAlign="center" creationComplete="onCreationComplete();"> . } ]]> - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/FlashMicSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/FlashMicSettings.mxml index f9b180daa6..c5fab8fe03 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/FlashMicSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/FlashMicSettings.mxml @@ -25,8 +25,7 @@ with BigBlueButton; if not, see . width="600" height="390" verticalScrollPolicy="off" creationComplete="onCreationComplete()" - showCloseButton="false" - close="onCancelClicked()" + showCloseButton="false" keyDown="handleKeyDown(event)"> @@ -44,7 +43,6 @@ with BigBlueButton; if not, see . import flash.ui.Keyboard; import mx.controls.sliderClasses.Slider; - import mx.events.CloseEvent; import mx.events.SliderEvent; import org.as3commons.logging.api.ILogger; @@ -184,7 +182,7 @@ with BigBlueButton; if not, see . // Added by Chad to enable closing the window without clicking the X private function handleKeyDown(event:KeyboardEvent):void { if (event.charCode == Keyboard.ESCAPE) { - this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE)); + onCancelClicked(); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml index 21262cec7d..21601df606 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/GuestWindow.mxml @@ -128,7 +128,6 @@ $Id: $ public function closeWindow():void { this.visible = false; PopUpManager.removePopUp(this); - //dispatchEvent(new CloseEvent(CloseEvent.CLOSE)); } ]]> diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml index cba5732e21..82da5cbe34 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/LockSettings.mxml @@ -21,15 +21,14 @@ with BigBlueButton; if not, see . . private function handleKeyDown(event:KeyboardEvent):void { if (event.charCode == Keyboard.ESCAPE) { - this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE)); + onCancelClicked(); } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/LogoutWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/LogoutWindow.mxml index 1d7dfdbee6..7fbcafb862 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/LogoutWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/LogoutWindow.mxml @@ -22,6 +22,7 @@ with BigBlueButton; if not, see . . } private function wrongLocaleVersion():void { - var localeWindow:OldLocaleWarnWindow = PopUpUtil.createNonModelPopUp(mdiCanvas, OldLocaleWarnWindow, false) as OldLocaleWarnWindow; + var localeWindow:OldLocaleWarnWindow = PopUpUtil.createNonModalPopUp(mdiCanvas, OldLocaleWarnWindow, false) as OldLocaleWarnWindow; if (localeWindow) { var point1:Point = new Point(); // Calculate position of TitleWindow in Application's coordinates. @@ -673,7 +673,7 @@ with BigBlueButton; if not, see . } private function showbrowserPermissionHelper() : void { - var browserPermissionHelper : BrowserPermissionHelper = PopUpUtil.createNonModelPopUp(mdiCanvas, BrowserPermissionHelper, false) as BrowserPermissionHelper; + var browserPermissionHelper : BrowserPermissionHelper = PopUpUtil.createNonModalPopUp(mdiCanvas, BrowserPermissionHelper, false) as BrowserPermissionHelper; if (browserPermissionHelper) { browserPermissionHelper.currentState = "chromeCam"; browserPermissionHelper.x = 20; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml index f939574e96..4c89be6da6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainToolbar.mxml @@ -75,6 +75,7 @@ with BigBlueButton; if not, see . import org.bigbluebutton.common.events.ToolbarButtonEvent; import org.bigbluebutton.core.BBB; import org.bigbluebutton.core.Options; + import org.bigbluebutton.core.PopUpUtil; import org.bigbluebutton.core.TimerUtil; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.events.MeetingTimeRemainingEvent; @@ -300,14 +301,11 @@ with BigBlueButton; if not, see . private function confirmLogout():void { if (toolbarOptions.confirmLogout) { - var logoutWindow:LogoutWindow; - logoutWindow = LogoutWindow(PopUpManager.createPopUp(FlexGlobals.topLevelApplication as DisplayObject, LogoutWindow, true)); + var logoutWindow:LogoutWindow = PopUpUtil.createModalPopUp(FlexGlobals.topLevelApplication as DisplayObject, LogoutWindow, true) as LogoutWindow; var newX:Number = this.width - logoutWindow.width - 5; var newY:Number = btnLogout.y + btnLogout.height + 5; - PopUpManager.centerPopUp(logoutWindow); - logoutWindow.x = newX; logoutWindow.y = newY; } else { @@ -517,8 +515,9 @@ with BigBlueButton; if not, see . } private function onSettingsButtonClick():void { - settingsPopup = BBBSettings(PopUpManager.createPopUp(this.parent, BBBSettings, true)); + settingsPopup = PopUpUtil.createModalPopUp(this.parent, BBBSettings, true) as BBBSettings; settingsPopup.pushComponents(settingsComponents); + PopUpManager.centerPopUp(settingsPopup); } private function refreshRole(e:ChangeMyRole):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/WebRTCEchoTest.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/WebRTCEchoTest.mxml index 87f69ff8a2..2e31a4454a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/WebRTCEchoTest.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/WebRTCEchoTest.mxml @@ -24,8 +24,7 @@ with BigBlueButton; if not, see . xmlns:common="org.bigbluebutton.common.*" width="600" height="380" creationComplete="onCreationComplete()" - showCloseButton="false" - close="onCancelClicked()"> + showCloseButton="false"> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as index 1cc0824e14..8789bd413f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/managers/LayoutManager.as @@ -33,7 +33,6 @@ package org.bigbluebutton.modules.layout.managers import mx.events.CloseEvent; import mx.events.EffectEvent; import mx.events.ResizeEvent; - import mx.managers.PopUpManager; import flexlib.mdi.containers.MDICanvas; import flexlib.mdi.containers.MDIWindow; @@ -43,6 +42,7 @@ package org.bigbluebutton.modules.layout.managers import org.as3commons.logging.api.getClassLogger; import org.bigbluebutton.common.CustomMdiWindow; import org.bigbluebutton.core.Options; + import org.bigbluebutton.core.PopUpUtil; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.events.SwitchedLayoutEvent; import org.bigbluebutton.core.model.LiveMeeting; @@ -130,9 +130,8 @@ package org.bigbluebutton.modules.layout.managers public function alertSaveCurrentLayoutFile(e:CloseEvent):void { // Check to see if the YES button was pressed. if (e.detail==Alert.YES) { - var layoutNameWindow:CustomLayoutNameWindow = PopUpManager.createPopUp(FlexGlobals.topLevelApplication as DisplayObject, CustomLayoutNameWindow, true) as CustomLayoutNameWindow; + var layoutNameWindow:CustomLayoutNameWindow = PopUpUtil.createModalPopUp(FlexGlobals.topLevelApplication as DisplayObject, CustomLayoutNameWindow, true) as CustomLayoutNameWindow; layoutNameWindow.savingForFileDownload = true; - PopUpManager.centerPopUp(layoutNameWindow); } else if (e.detail==Alert.NO){ saveLayoutsWindow(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/AddButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/AddButton.mxml index 8379e718a5..94a959779e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/AddButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/AddButton.mxml @@ -34,9 +34,8 @@ with BigBlueButton; if not, see . import flash.events.Event; import mx.core.FlexGlobals; - import mx.core.IFlexDisplayObject; - import mx.managers.PopUpManager; + import org.bigbluebutton.core.PopUpUtil; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.util.i18n.ResourceUtil; @@ -46,8 +45,7 @@ with BigBlueButton; if not, see . } private function onClick(e:Event):void { - var layoutNameWindow:IFlexDisplayObject = PopUpManager.createPopUp(FlexGlobals.topLevelApplication as DisplayObject, CustomLayoutNameWindow, true); - PopUpManager.centerPopUp(layoutNameWindow); + PopUpUtil.createModalPopUp(FlexGlobals.topLevelApplication as DisplayObject, CustomLayoutNameWindow, true); } public function refreshRole(amIModerator:Boolean):void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollChoicesModal.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollChoicesModal.mxml index 816fc93020..7ebd65c0be 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollChoicesModal.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollChoicesModal.mxml @@ -21,15 +21,17 @@ with BigBlueButton; if not, see . + implements="org.bigbluebutton.common.IKeyboardClose" + show="focusManager.setFocus(choiceFirst)"> . xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mate="http://mate.asfusion.com/" xmlns:common="org.bigbluebutton.common.*" + implements="org.bigbluebutton.common.IKeyboardClose" layout="absolute" width="580" height="410" + creationComplete="creationCompleteHandler(event)" close="onCancelClicked()" initialize="initData();" > @@ -37,6 +39,7 @@ with BigBlueButton; if not, see . . [Bindable] private var downloadablePresentations:ArrayCollection; + + protected function creationCompleteHandler(event:FlexEvent):void { + closeButton.setFocus() + } override public function move(x:Number, y:Number):void { return; @@ -56,6 +63,7 @@ with BigBlueButton; if not, see . private function onCancelClicked():void { globalDispatch.dispatchEvent(new DownloadEvent(DownloadEvent.CLOSE_DOWNLOAD_WINDOW)); } + ]]> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesNameWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesNameWindow.mxml index a116d25461..432a3b1bb3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesNameWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesNameWindow.mxml @@ -23,21 +23,22 @@ with BigBlueButton; if not, see . + width="280" xmlns:common="org.bigbluebutton.common.*"> . xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:mate="http://mate.asfusion.com/" xmlns:common="org.bigbluebutton.common.*" + implements="org.bigbluebutton.common.IKeyboardClose" + show="this.setFocus()" width="630" - close="onCloseClicked()" visible="false" showCloseButton="false"> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml index 8cbb7d6d08..1e68d2f5e3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml @@ -23,6 +23,8 @@ with BigBlueButton; if not, see . diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml index 83a32b1162..d7b7202450 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml @@ -375,7 +375,7 @@ $Id: $ } private function openEmojiStatusMenu():void { - var moodMenu:MoodMenu = PopUpUtil.createNonModelPopUp(DisplayObject(FlexGlobals.topLevelApplication), MoodMenu, false) as MoodMenu; + var moodMenu:MoodMenu = PopUpUtil.createNonModalPopUp(DisplayObject(FlexGlobals.topLevelApplication), MoodMenu, false) as MoodMenu; moodMenu.btn = emojiStatusBtn; moodMenu.show(); } From 5c765072c46cb0d8266ec45fae93a81cbe584042 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Mon, 16 Oct 2017 14:32:05 -0700 Subject: [PATCH 20/37] - start implementing rights management --- .../core/apps/PermisssionCheck.scala | 38 +++++++++++++++++-- .../bigbluebutton/core/models/Users2x.scala | 1 + .../core/running/MeetingActor.scala | 1 - 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala index ff2cd9f214..a571e34db1 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala @@ -1,10 +1,40 @@ package org.bigbluebutton.core.apps -import org.bigbluebutton.common2.domain.UserVO +import org.bigbluebutton.core.models.{ Roles, UserState } -trait PermisssionCheck { +object PermisssionCheck { - def isAllowed(permission: String, role: String, user: UserVO): Boolean = { - true + val MOD_LEVEL = 100 + val AUTHED_LEVEL = 50 + val GUEST_LEVEL = 0 + + val PRESENTER_LEVEL = 100 + val VIEWER_LEVEL = 0 + + private def permissionToLevel(user: UserState): Int = { + if (user.authed) { + if (user.role == Roles.MODERATOR_ROLE) MOD_LEVEL else AUTHED_LEVEL + } else { + GUEST_LEVEL + } } + + private def roleToLevel(user: UserState): Int = { + if (user.role == Roles.PRESENTER_ROLE) PRESENTER_LEVEL else VIEWER_LEVEL + } + + /** + * This method will check if the user that issued the command has the correct permissions. + * + * Example of the permissions level are "AUTHENTICATED", "MODERATOR" and "GUEST". Example of roles + * are "VIEWER" and "PRESENTER". + * + * @param permissionLevel Lowest permission needed to have access. + * @param roleLevel Lowest role needed to have access. + * @return true allows API to execute, false denies executing API + */ + def isAllowed(permissionLevel: Int, roleLevel: Int, user: UserState): Boolean = { + (permissionLevel <= permissionToLevel(user) && roleLevel <= roleToLevel(user)) + } + } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala index 4aab105abb..5db326eee5 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Users2x.scala @@ -167,4 +167,5 @@ object Roles { val PRESENTER_ROLE = "PRESENTER" val VIEWER_ROLE = "VIEWER" val GUEST_ROLE = "GUEST" + val AUTHENTICATED_ROLE = "AUTHENTICATED" } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index 57e151702c..e0ef5cb749 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -62,7 +62,6 @@ class MeetingActor( with BreakoutApp2x with UsersApp2x - with PermisssionCheck with UserBroadcastCamStartMsgHdlr with UserJoinMeetingReqMsgHdlr with UserJoinMeetingAfterReconnectReqMsgHdlr From 4a48a69c7f420fa6d58b44434f9209bc1cb7d454 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Tue, 17 Oct 2017 11:41:05 -0700 Subject: [PATCH 21/37] - start implementing rights management --- .../src/main/resources/application.conf | 4 + .../bigbluebutton/SystemConfiguration.scala | 2 + .../core/apps/PermisssionCheck.scala | 23 ++++- ...hangeLockSettingsInMeetingCmdMsgHdlr.scala | 93 +++++++++++-------- 4 files changed, 78 insertions(+), 44 deletions(-) diff --git a/akka-bbb-apps/src/main/resources/application.conf b/akka-bbb-apps/src/main/resources/application.conf index f53ba26d85..d7c9e9de65 100755 --- a/akka-bbb-apps/src/main/resources/application.conf +++ b/akka-bbb-apps/src/main/resources/application.conf @@ -79,3 +79,7 @@ services { telizeHost = "www.telize.com" telizePort = 80 } + +apps { + checkPermissions = true +} \ No newline at end of file diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala index 9c3ec7515e..fc33700250 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/SystemConfiguration.scala @@ -59,4 +59,6 @@ trait SystemConfiguration { lazy val httpPort = Try(config.getInt("http.port")).getOrElse(9090) lazy val telizeHost = Try(config.getString("services.telizeHost")).getOrElse("") lazy val telizePort = Try(config.getInt("services.telizePort")).getOrElse(80) + + lazy val applyPermissionCheck = Try(config.getBoolean("apps.checkPermissions")).getOrElse(false) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala index a571e34db1..f48ac26a12 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala @@ -1,6 +1,8 @@ package org.bigbluebutton.core.apps -import org.bigbluebutton.core.models.{ Roles, UserState } +import org.bigbluebutton.core.models.{Roles, UserState, Users2x} +import org.bigbluebutton.core.running.OutMsgRouter +import org.bigbluebutton.core2.message.senders.MsgBuilder object PermisssionCheck { @@ -12,8 +14,10 @@ object PermisssionCheck { val VIEWER_LEVEL = 0 private def permissionToLevel(user: UserState): Int = { - if (user.authed) { - if (user.role == Roles.MODERATOR_ROLE) MOD_LEVEL else AUTHED_LEVEL + if (user.role == Roles.MODERATOR_ROLE) { + MOD_LEVEL + } else if (user.authed) { + AUTHED_LEVEL } else { GUEST_LEVEL } @@ -33,8 +37,17 @@ object PermisssionCheck { * @param roleLevel Lowest role needed to have access. * @return true allows API to execute, false denies executing API */ - def isAllowed(permissionLevel: Int, roleLevel: Int, user: UserState): Boolean = { - (permissionLevel <= permissionToLevel(user) && roleLevel <= roleToLevel(user)) + def isAllowed(permissionLevel: Int, roleLevel: Int, users: Users2x, userId: String): Boolean = { + Users2x.findWithIntId(users, userId) match { + case Some(user) => (permissionToLevel(user) >= permissionLevel && roleToLevel(user) >= roleLevel) + case None => false + } + } + def ejectUserForFailedPermission(meetingId: String, userId: String, reason: String, outGW: OutMsgRouter):Unit = { + // send a system message to force disconnection + val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg(meetingId, userId, reason) + outGW.send(ejectFromMeetingSystemEvent) + } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala index 6da0a9e763..01604cb904 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala @@ -1,58 +1,73 @@ package org.bigbluebutton.core.apps.users +import org.bigbluebutton.SystemConfiguration import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.api.Permissions -import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter } +import org.bigbluebutton.core.apps.PermisssionCheck +import org.bigbluebutton.core.models.Users2x +import org.bigbluebutton.core.running.{MeetingActor, OutMsgRouter} import org.bigbluebutton.core.running.MeetingActor import org.bigbluebutton.core2.MeetingStatus2x -trait ChangeLockSettingsInMeetingCmdMsgHdlr { +trait ChangeLockSettingsInMeetingCmdMsgHdlr extends SystemConfiguration { this: MeetingActor => val outGW: OutMsgRouter def handleSetLockSettings(msg: ChangeLockSettingsInMeetingCmdMsg): Unit = { - val settings = Permissions( - disableCam = msg.body.disableCam, - disableMic = msg.body.disableMic, - disablePrivChat = msg.body.disablePrivChat, - disablePubChat = msg.body.disablePubChat, - lockedLayout = msg.body.lockedLayout, - lockOnJoin = msg.body.lockOnJoin, - lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable - ) - if (!MeetingStatus2x.permissionsEqual(liveMeeting.status, settings) || !MeetingStatus2x.permisionsInitialized(liveMeeting.status)) { - MeetingStatus2x.initializePermissions(liveMeeting.status) + val isAllowed = PermisssionCheck.isAllowed(PermisssionCheck.MOD_LEVEL, + PermisssionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.body.setBy) - MeetingStatus2x.setPermissions(liveMeeting.status, settings) - - val routing = Routing.addMsgToClientRouting( - MessageTypes.BROADCAST_TO_MEETING, - props.meetingProp.intId, - msg.body.setBy - ) - val envelope = BbbCoreEnvelope( - LockSettingsInMeetingChangedEvtMsg.NAME, - routing - ) - val body = LockSettingsInMeetingChangedEvtMsgBody( - disableCam = settings.disableCam, - disableMic = settings.disableMic, - disablePrivChat = settings.disablePrivChat, - disablePubChat = settings.disablePubChat, - lockedLayout = settings.lockedLayout, - lockOnJoin = settings.lockOnJoin, - lockOnJoinConfigurable = settings.lockOnJoinConfigurable, - msg.body.setBy - ) - val header = BbbClientMsgHeader( - LockSettingsInMeetingChangedEvtMsg.NAME, - props.meetingProp.intId, - msg.body.setBy + if (applyPermissionCheck && !isAllowed) { + val meetingId = liveMeeting.props.meetingProp.intId + val reason = "No permission to change lock settings" + PermisssionCheck.ejectUserForFailedPermission(meetingId, msg.body.setBy, reason, outGW) + } else { + val settings = Permissions( + disableCam = msg.body.disableCam, + disableMic = msg.body.disableMic, + disablePrivChat = msg.body.disablePrivChat, + disablePubChat = msg.body.disablePubChat, + lockedLayout = msg.body.lockedLayout, + lockOnJoin = msg.body.lockOnJoin, + lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable ) - outGW.send(BbbCommonEnvCoreMsg(envelope, LockSettingsInMeetingChangedEvtMsg(header, body))) + if (!MeetingStatus2x.permissionsEqual(liveMeeting.status, settings) || !MeetingStatus2x.permisionsInitialized(liveMeeting.status)) { + MeetingStatus2x.initializePermissions(liveMeeting.status) + + MeetingStatus2x.setPermissions(liveMeeting.status, settings) + + val routing = Routing.addMsgToClientRouting( + MessageTypes.BROADCAST_TO_MEETING, + props.meetingProp.intId, + msg.body.setBy + ) + val envelope = BbbCoreEnvelope( + LockSettingsInMeetingChangedEvtMsg.NAME, + routing + ) + val body = LockSettingsInMeetingChangedEvtMsgBody( + disableCam = settings.disableCam, + disableMic = settings.disableMic, + disablePrivChat = settings.disablePrivChat, + disablePubChat = settings.disablePubChat, + lockedLayout = settings.lockedLayout, + lockOnJoin = settings.lockOnJoin, + lockOnJoinConfigurable = settings.lockOnJoinConfigurable, + msg.body.setBy + ) + val header = BbbClientMsgHeader( + LockSettingsInMeetingChangedEvtMsg.NAME, + props.meetingProp.intId, + msg.body.setBy + ) + + outGW.send(BbbCommonEnvCoreMsg(envelope, LockSettingsInMeetingChangedEvtMsg(header, body))) + } } + + } } From 55e371fce27f136de931461dafbcfbe01851736d Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Tue, 17 Oct 2017 12:37:22 -0700 Subject: [PATCH 22/37] - layer rights management traits --- .../core/apps/PermisssionCheck.scala | 8 +- ...hangeLockSettingsInMeetingCmdMsgHdlr.scala | 115 ++++++++++-------- .../handlers/MuteMeetingCmdMsgHdlr.scala | 32 ++++- 3 files changed, 97 insertions(+), 58 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala index f48ac26a12..4c17886514 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala @@ -1,6 +1,6 @@ package org.bigbluebutton.core.apps -import org.bigbluebutton.core.models.{Roles, UserState, Users2x} +import org.bigbluebutton.core.models.{ Roles, UserState, Users2x } import org.bigbluebutton.core.running.OutMsgRouter import org.bigbluebutton.core2.message.senders.MsgBuilder @@ -17,7 +17,7 @@ object PermisssionCheck { if (user.role == Roles.MODERATOR_ROLE) { MOD_LEVEL } else if (user.authed) { - AUTHED_LEVEL + AUTHED_LEVEL } else { GUEST_LEVEL } @@ -40,12 +40,12 @@ object PermisssionCheck { def isAllowed(permissionLevel: Int, roleLevel: Int, users: Users2x, userId: String): Boolean = { Users2x.findWithIntId(users, userId) match { case Some(user) => (permissionToLevel(user) >= permissionLevel && roleToLevel(user) >= roleLevel) - case None => false + case None => false } } - def ejectUserForFailedPermission(meetingId: String, userId: String, reason: String, outGW: OutMsgRouter):Unit = { + def ejectUserForFailedPermission(meetingId: String, userId: String, reason: String, outGW: OutMsgRouter): Unit = { // send a system message to force disconnection val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg(meetingId, userId, reason) outGW.send(ejectFromMeetingSystemEvent) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala index 01604cb904..b43ee36a44 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/ChangeLockSettingsInMeetingCmdMsgHdlr.scala @@ -4,70 +4,83 @@ import org.bigbluebutton.SystemConfiguration import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.api.Permissions import org.bigbluebutton.core.apps.PermisssionCheck -import org.bigbluebutton.core.models.Users2x -import org.bigbluebutton.core.running.{MeetingActor, OutMsgRouter} +import org.bigbluebutton.core.running.{ OutMsgRouter } import org.bigbluebutton.core.running.MeetingActor import org.bigbluebutton.core2.MeetingStatus2x -trait ChangeLockSettingsInMeetingCmdMsgHdlr extends SystemConfiguration { +trait ChangeLockSettingsInMeetingCmdMsgHdlrDefault { + def handleSetLockSettings(msg: ChangeLockSettingsInMeetingCmdMsg): Unit = {} +} + +trait ChangeLockSettingsInMeetingCmdMsgHdlrCheckPerm + extends ChangeLockSettingsInMeetingCmdMsgHdlrDefault with SystemConfiguration { this: MeetingActor => val outGW: OutMsgRouter - def handleSetLockSettings(msg: ChangeLockSettingsInMeetingCmdMsg): Unit = { - - val isAllowed = PermisssionCheck.isAllowed(PermisssionCheck.MOD_LEVEL, - PermisssionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.body.setBy) + override def handleSetLockSettings(msg: ChangeLockSettingsInMeetingCmdMsg): Unit = { + val isAllowed = PermisssionCheck.isAllowed( + PermisssionCheck.MOD_LEVEL, + PermisssionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.body.setBy + ) if (applyPermissionCheck && !isAllowed) { val meetingId = liveMeeting.props.meetingProp.intId val reason = "No permission to change lock settings" PermisssionCheck.ejectUserForFailedPermission(meetingId, msg.body.setBy, reason, outGW) } else { - val settings = Permissions( - disableCam = msg.body.disableCam, - disableMic = msg.body.disableMic, - disablePrivChat = msg.body.disablePrivChat, - disablePubChat = msg.body.disablePubChat, - lockedLayout = msg.body.lockedLayout, - lockOnJoin = msg.body.lockOnJoin, - lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable - ) - - if (!MeetingStatus2x.permissionsEqual(liveMeeting.status, settings) || !MeetingStatus2x.permisionsInitialized(liveMeeting.status)) { - MeetingStatus2x.initializePermissions(liveMeeting.status) - - MeetingStatus2x.setPermissions(liveMeeting.status, settings) - - val routing = Routing.addMsgToClientRouting( - MessageTypes.BROADCAST_TO_MEETING, - props.meetingProp.intId, - msg.body.setBy - ) - val envelope = BbbCoreEnvelope( - LockSettingsInMeetingChangedEvtMsg.NAME, - routing - ) - val body = LockSettingsInMeetingChangedEvtMsgBody( - disableCam = settings.disableCam, - disableMic = settings.disableMic, - disablePrivChat = settings.disablePrivChat, - disablePubChat = settings.disablePubChat, - lockedLayout = settings.lockedLayout, - lockOnJoin = settings.lockOnJoin, - lockOnJoinConfigurable = settings.lockOnJoinConfigurable, - msg.body.setBy - ) - val header = BbbClientMsgHeader( - LockSettingsInMeetingChangedEvtMsg.NAME, - props.meetingProp.intId, - msg.body.setBy - ) - - outGW.send(BbbCommonEnvCoreMsg(envelope, LockSettingsInMeetingChangedEvtMsg(header, body))) - } + super.handleSetLockSettings(msg) + } + } +} + +trait ChangeLockSettingsInMeetingCmdMsgHdlr extends ChangeLockSettingsInMeetingCmdMsgHdlrCheckPerm { + this: MeetingActor => + + val outGW: OutMsgRouter + + override def handleSetLockSettings(msg: ChangeLockSettingsInMeetingCmdMsg): Unit = { + val settings = Permissions( + disableCam = msg.body.disableCam, + disableMic = msg.body.disableMic, + disablePrivChat = msg.body.disablePrivChat, + disablePubChat = msg.body.disablePubChat, + lockedLayout = msg.body.lockedLayout, + lockOnJoin = msg.body.lockOnJoin, + lockOnJoinConfigurable = msg.body.lockOnJoinConfigurable + ) + + if (!MeetingStatus2x.permissionsEqual(liveMeeting.status, settings) || !MeetingStatus2x.permisionsInitialized(liveMeeting.status)) { + MeetingStatus2x.initializePermissions(liveMeeting.status) + + MeetingStatus2x.setPermissions(liveMeeting.status, settings) + + val routing = Routing.addMsgToClientRouting( + MessageTypes.BROADCAST_TO_MEETING, + props.meetingProp.intId, + msg.body.setBy + ) + val envelope = BbbCoreEnvelope( + LockSettingsInMeetingChangedEvtMsg.NAME, + routing + ) + val body = LockSettingsInMeetingChangedEvtMsgBody( + disableCam = settings.disableCam, + disableMic = settings.disableMic, + disablePrivChat = settings.disablePrivChat, + disablePubChat = settings.disablePubChat, + lockedLayout = settings.lockedLayout, + lockOnJoin = settings.lockOnJoin, + lockOnJoinConfigurable = settings.lockOnJoinConfigurable, + msg.body.setBy + ) + val header = BbbClientMsgHeader( + LockSettingsInMeetingChangedEvtMsg.NAME, + props.meetingProp.intId, + msg.body.setBy + ) + + outGW.send(BbbCommonEnvCoreMsg(envelope, LockSettingsInMeetingChangedEvtMsg(header, body))) } - - } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala index 2329525967..f7608d8447 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala @@ -1,17 +1,43 @@ package org.bigbluebutton.core2.message.handlers +import org.bigbluebutton.SystemConfiguration import org.bigbluebutton.common2.msgs._ -import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.apps.PermisssionCheck import org.bigbluebutton.core.models.{ VoiceUserState, VoiceUsers } import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter } import org.bigbluebutton.core2.MeetingStatus2x -trait MuteMeetingCmdMsgHdlr { +trait MuteMeetingCmdMsgHdlrDefault { + def handleMuteMeetingCmdMsg(msg: MuteMeetingCmdMsg): Unit = {} +} + +trait MuteMeetingCmdMsgHdlrCheckPerm extends MuteMeetingCmdMsgHdlrDefault with SystemConfiguration { this: MeetingActor => val outGW: OutMsgRouter - def handleMuteMeetingCmdMsg(msg: MuteMeetingCmdMsg) { + override def handleMuteMeetingCmdMsg(msg: MuteMeetingCmdMsg): Unit = { + val isAllowed = PermisssionCheck.isAllowed( + PermisssionCheck.MOD_LEVEL, + PermisssionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.body.mutedBy + ) + + if (applyPermissionCheck && !isAllowed) { + val meetingId = liveMeeting.props.meetingProp.intId + val reason = "No permission to change lock settings" + PermisssionCheck.ejectUserForFailedPermission(meetingId, msg.body.mutedBy, reason, outGW) + } else { + super.handleMuteMeetingCmdMsg(msg) + } + } +} + +trait MuteMeetingCmdMsgHdlr extends MuteMeetingCmdMsgHdlrCheckPerm { + this: MeetingActor => + + val outGW: OutMsgRouter + + override def handleMuteMeetingCmdMsg(msg: MuteMeetingCmdMsg): Unit = { def build(meetingId: String, userId: String, muted: Boolean, mutedBy: String): BbbCommonEnvCoreMsg = { val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId) From a5ddf0b2038e5fa7935755b2aae59ce88884600d Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Tue, 17 Oct 2017 13:57:57 -0700 Subject: [PATCH 23/37] - setup layered handler traits for rights management --- .../core/apps/PermisssionCheck.scala | 14 +++-- .../core/apps/users/MuteUserCmdMsgHdlr.scala | 52 ++++++++++++++++--- .../core/apps/users/UsersApp.scala | 4 +- .../core/running/MeetingActor.scala | 5 +- .../handlers/MuteMeetingCmdMsgHdlr.scala | 4 +- 5 files changed, 64 insertions(+), 15 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala index 4c17886514..baa7c116c8 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala @@ -24,7 +24,7 @@ object PermisssionCheck { } private def roleToLevel(user: UserState): Int = { - if (user.role == Roles.PRESENTER_ROLE) PRESENTER_LEVEL else VIEWER_LEVEL + if (user.presenter) PRESENTER_LEVEL else VIEWER_LEVEL } /** @@ -39,8 +39,16 @@ object PermisssionCheck { */ def isAllowed(permissionLevel: Int, roleLevel: Int, users: Users2x, userId: String): Boolean = { Users2x.findWithIntId(users, userId) match { - case Some(user) => (permissionToLevel(user) >= permissionLevel && roleToLevel(user) >= roleLevel) - case None => false + case Some(user) => + println("permissionToLevel = " + permissionToLevel(user) + " permissionLevel=" + permissionLevel) + val permLevelCheck = permissionToLevel(user) >= permissionLevel + println("roleToLevel = " + roleToLevel(user) + " roleLevel=" + roleLevel) + val roleLevelCheck = roleToLevel(user) >= roleLevel + println("PERMLEVELCHECK = " + permissionToLevel(user) + " ROLELEVELCHECK=" + permissionLevel) + + println("PERMLEVELCHECK = " + permLevelCheck + " ROLELEVELCHECK=" + roleLevelCheck) + permLevelCheck && roleLevelCheck + case None => false } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/MuteUserCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/MuteUserCmdMsgHdlr.scala index 2c6673797b..3f1709c6ca 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/MuteUserCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/MuteUserCmdMsgHdlr.scala @@ -1,23 +1,61 @@ package org.bigbluebutton.core.apps.users +import org.bigbluebutton.SystemConfiguration import org.bigbluebutton.common2.msgs.MuteUserCmdMsg +import org.bigbluebutton.core.apps.PermisssionCheck import org.bigbluebutton.core.models.VoiceUsers -import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter } +import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } import org.bigbluebutton.core2.message.senders.MsgBuilder -trait MuteUserCmdMsgHdlr { - this: MeetingActor => +trait MuteUserCmdMsgHdlrDefault { + def handleMuteUserCmdMsg(msg: MuteUserCmdMsg): Unit = { + println("**************** MuteUserCmdMsgHdlrDefault ") + } +} +trait MuteUserCmdMsgHdlrPermCheck extends MuteUserCmdMsgHdlrDefault with SystemConfiguration { + this: UsersApp => + + val liveMeeting: LiveMeeting val outGW: OutMsgRouter - def handleMuteUserCmdMsg(msg: MuteUserCmdMsg) { - log.info("Received mute user request. meetingId=" + props.meetingProp.intId + " userId=" + override def handleMuteUserCmdMsg(msg: MuteUserCmdMsg): Unit = { + println("**************** MuteUserCmdMsgHdlrPermCheck ") + + val isAllowed = PermisssionCheck.isAllowed( + PermisssionCheck.MOD_LEVEL, + PermisssionCheck.PRESENTER_LEVEL, liveMeeting.users2x, msg.body.mutedBy + ) + + if (applyPermissionCheck && !isAllowed) { + val meetingId = liveMeeting.props.meetingProp.intId + val reason = "No permission to mute user in meeting." + PermisssionCheck.ejectUserForFailedPermission(meetingId, msg.body.mutedBy, reason, outGW) + } else { + super.handleMuteUserCmdMsg(msg) + } + } +} + +trait MuteUserCmdMsgHdlr extends MuteUserCmdMsgHdlrDefault { + this: UsersApp => + + val liveMeeting: LiveMeeting + val outGW: OutMsgRouter + + override def handleMuteUserCmdMsg(msg: MuteUserCmdMsg) { + println("**************** MuteUserCmdMsgHdlr ") + + val meetingId = liveMeeting.props.meetingProp.intId + val voiceConf = liveMeeting.props.voiceProp.voiceConf + + log.info("Received mute user request. meetingId=" + meetingId + " userId=" + msg.body.userId) for { u <- VoiceUsers.findWithIntId(liveMeeting.voiceUsers, msg.body.userId) } yield { - log.info("Send mute user request. meetingId=" + props.meetingProp.intId + " userId=" + u.intId + " user=" + u) - val event = MsgBuilder.buildMuteUserInVoiceConfSysMsg(props.meetingProp.intId, props.voiceProp.voiceConf, + log.info("Send mute user request. meetingId=" + meetingId + " userId=" + u.intId + " user=" + u) + val event = MsgBuilder.buildMuteUserInVoiceConfSysMsg(meetingId, voiceConf, u.voiceUserId, !u.muted) outGW.send(event) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala index 8bb0e15f53..fe8843c61e 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UsersApp.scala @@ -21,7 +21,9 @@ class UsersApp( with SetRecordingStatusCmdMsgHdlr with GetRecordingStatusReqMsgHdlr with AssignPresenterReqMsgHdlr - with EjectUserFromMeetingCmdMsgHdlr { + with EjectUserFromMeetingCmdMsgHdlr + with MuteUserCmdMsgHdlr + with MuteUserCmdMsgHdlrPermCheck { val log = Logging(context.system, getClass) } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index e0ef5cb749..7ca1345e8a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -70,8 +70,9 @@ class MeetingActor( with UserDisconnectedFromGlobalAudioMsgHdlr with MuteAllExceptPresentersCmdMsgHdlr with MuteMeetingCmdMsgHdlr + with MuteMeetingCmdMsgHdlrCheckPerm with IsMeetingMutedReqMsgHdlr - with MuteUserCmdMsgHdlr + with EjectUserFromVoiceCmdMsgHdlr with EndMeetingSysCmdMsgHdlr with DestroyMeetingSysCmdMsgHdlr @@ -264,7 +265,7 @@ class MeetingActor( case m: UserMutedInVoiceConfEvtMsg => handleUserMutedInVoiceConfEvtMsg(m) case m: UserTalkingInVoiceConfEvtMsg => handleUserTalkingInVoiceConfEvtMsg(m) case m: RecordingStartedVoiceConfEvtMsg => handleRecordingStartedVoiceConfEvtMsg(m) - case m: MuteUserCmdMsg => handleMuteUserCmdMsg(m) + case m: MuteUserCmdMsg => usersApp.handleMuteUserCmdMsg(m) case m: MuteAllExceptPresentersCmdMsg => handleMuteAllExceptPresentersCmdMsg(m) case m: EjectUserFromVoiceCmdMsg => handleEjectUserFromVoiceCmdMsg(m) case m: IsMeetingMutedReqMsg => handleIsMeetingMutedReqMsg(m) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala index f7608d8447..493cb56294 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/handlers/MuteMeetingCmdMsgHdlr.scala @@ -24,7 +24,7 @@ trait MuteMeetingCmdMsgHdlrCheckPerm extends MuteMeetingCmdMsgHdlrDefault with S if (applyPermissionCheck && !isAllowed) { val meetingId = liveMeeting.props.meetingProp.intId - val reason = "No permission to change lock settings" + val reason = "No permission to mute meeting." PermisssionCheck.ejectUserForFailedPermission(meetingId, msg.body.mutedBy, reason, outGW) } else { super.handleMuteMeetingCmdMsg(msg) @@ -32,7 +32,7 @@ trait MuteMeetingCmdMsgHdlrCheckPerm extends MuteMeetingCmdMsgHdlrDefault with S } } -trait MuteMeetingCmdMsgHdlr extends MuteMeetingCmdMsgHdlrCheckPerm { +trait MuteMeetingCmdMsgHdlr extends MuteMeetingCmdMsgHdlrDefault { this: MeetingActor => val outGW: OutMsgRouter From 313440abdd74fefe4d0ba506fce0442e07da3962 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Tue, 17 Oct 2017 15:01:10 -0700 Subject: [PATCH 24/37] - send an eject message to the client so client doesn't attempt to auto-reconnect --- .../bigbluebutton/core/apps/PermisssionCheck.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala index baa7c116c8..dbcd356527 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala @@ -44,16 +44,26 @@ object PermisssionCheck { val permLevelCheck = permissionToLevel(user) >= permissionLevel println("roleToLevel = " + roleToLevel(user) + " roleLevel=" + roleLevel) val roleLevelCheck = roleToLevel(user) >= roleLevel - println("PERMLEVELCHECK = " + permissionToLevel(user) + " ROLELEVELCHECK=" + permissionLevel) println("PERMLEVELCHECK = " + permLevelCheck + " ROLELEVELCHECK=" + roleLevelCheck) permLevelCheck && roleLevelCheck + false case None => false } } + private def sendEjectMessageToClient(meetingId: String, userId: String, + outGW: OutMsgRouter, ejectedBy: String): Unit = { + val ejectFromMeetingClientEvent = MsgBuilder.buildUserEjectedFromMeetingEvtMsg( + meetingId, userId, ejectedBy + ) + outGW.send(ejectFromMeetingClientEvent) + } + def ejectUserForFailedPermission(meetingId: String, userId: String, reason: String, outGW: OutMsgRouter): Unit = { + sendEjectMessageToClient(meetingId, userId, outGW, "SYSTEM") + // send a system message to force disconnection val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg(meetingId, userId, reason) outGW.send(ejectFromMeetingSystemEvent) From da9e2ef3a484ada5d80073d681e154c0e66e2661 Mon Sep 17 00:00:00 2001 From: Joao Siebel Date: Wed, 18 Oct 2017 10:30:33 -0200 Subject: [PATCH 25/37] Fix function name in updateVoiceUser --- .../imports/api/voice-users/server/modifiers/updateVoiceUser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d7d6dfc520..42ceb95d31 100644 --- a/bigbluebutton-html5/imports/api/voice-users/server/modifiers/updateVoiceUser.js +++ b/bigbluebutton-html5/imports/api/voice-users/server/modifiers/updateVoiceUser.js @@ -3,7 +3,7 @@ import Logger from '/imports/startup/server/logger'; import VoiceUsers from '/imports/api/voice-users'; import flat from 'flat'; -export default function removeVoiceUser(meetingId, voiceUser) { +export default function updateVoiceUser(meetingId, voiceUser) { check(meetingId, String); check(voiceUser, { intId: String, From cbd82ffa2910207b337fecc23ad62ecaa455af80 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Wed, 18 Oct 2017 10:07:54 -0700 Subject: [PATCH 26/37] - simplify sending of message --- .../core/apps/PermisssionCheck.scala | 16 ++++----------- .../EjectUserFromMeetingCmdMsgHdlr.scala | 16 +++++++-------- .../core2/message/senders/MsgBuilder.scala | 5 +++-- .../core2/message/senders/Sender.scala | 20 ++++++++++++++++--- .../bigbluebutton/common2/msgs/UsersMgs.scala | 2 +- 5 files changed, 33 insertions(+), 26 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala index dbcd356527..9c6f0e5757 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/PermisssionCheck.scala @@ -2,7 +2,7 @@ package org.bigbluebutton.core.apps import org.bigbluebutton.core.models.{ Roles, UserState, Users2x } import org.bigbluebutton.core.running.OutMsgRouter -import org.bigbluebutton.core2.message.senders.MsgBuilder +import org.bigbluebutton.core2.message.senders.{ MsgBuilder, Sender } object PermisssionCheck { @@ -53,19 +53,11 @@ object PermisssionCheck { } - private def sendEjectMessageToClient(meetingId: String, userId: String, - outGW: OutMsgRouter, ejectedBy: String): Unit = { - val ejectFromMeetingClientEvent = MsgBuilder.buildUserEjectedFromMeetingEvtMsg( - meetingId, userId, ejectedBy - ) - outGW.send(ejectFromMeetingClientEvent) - } - def ejectUserForFailedPermission(meetingId: String, userId: String, reason: String, outGW: OutMsgRouter): Unit = { - sendEjectMessageToClient(meetingId, userId, outGW, "SYSTEM") + val ejectedBy = "SYSTEM" + Sender.sendUserEjectedFromMeetingClientEvtMsg(meetingId, userId, ejectedBy, reason, outGW) // send a system message to force disconnection - val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg(meetingId, userId, reason) - outGW.send(ejectFromMeetingSystemEvent) + Sender.sendUserEjectedFromMeetingSystemMsg(meetingId, userId, ejectedBy, outGW) } } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/EjectUserFromMeetingCmdMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/EjectUserFromMeetingCmdMsgHdlr.scala index df1c0f32b8..ce9bbaebe0 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/EjectUserFromMeetingCmdMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/EjectUserFromMeetingCmdMsgHdlr.scala @@ -3,7 +3,7 @@ package org.bigbluebutton.core.apps.users import org.bigbluebutton.common2.msgs._ import org.bigbluebutton.core.models._ import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } -import org.bigbluebutton.core2.message.senders.MsgBuilder +import org.bigbluebutton.core2.message.senders.{ MsgBuilder, Sender } trait EjectUserFromMeetingCmdMsgHdlr { this: UsersApp => @@ -16,22 +16,22 @@ trait EjectUserFromMeetingCmdMsgHdlr { user <- Users2x.ejectFromMeeting(liveMeeting.users2x, msg.body.userId) } yield { RegisteredUsers.remove(msg.body.userId, liveMeeting.registeredUsers) - + val reason = "user ejected by another user" // send a message to client - val ejectFromMeetingClientEvent = MsgBuilder.buildUserEjectedFromMeetingEvtMsg( + Sender.sendUserEjectedFromMeetingClientEvtMsg( liveMeeting.props.meetingProp.intId, - user.intId, msg.body.ejectedBy + user.intId, msg.body.ejectedBy, reason, outGW ) - outGW.send(ejectFromMeetingClientEvent) + log.info("Ejecting user from meeting (client msg). meetingId=" + liveMeeting.props.meetingProp.intId + " userId=" + msg.body.userId) // send a system message to force disconnection - val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg( + Sender.sendUserEjectedFromMeetingSystemMsg( liveMeeting.props.meetingProp.intId, - user.intId, "eject-user" + user.intId, msg.body.ejectedBy, outGW ) - outGW.send(ejectFromMeetingSystemEvent) + log.info("Ejecting user from meeting (system msg). meetingId=" + liveMeeting.props.meetingProp.intId + " userId=" + msg.body.userId) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala index 0fd6aa92cd..3398e1f232 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/MsgBuilder.scala @@ -166,11 +166,12 @@ object MsgBuilder { BbbCommonEnvCoreMsg(envelope, event) } - def buildUserEjectedFromMeetingEvtMsg(meetingId: String, userId: String, ejectedBy: String): BbbCommonEnvCoreMsg = { + def buildUserEjectedFromMeetingEvtMsg(meetingId: String, userId: String, + ejectedBy: String, reason: String): BbbCommonEnvCoreMsg = { val routing = Routing.addMsgToClientRouting(MessageTypes.DIRECT, meetingId, userId) val envelope = BbbCoreEnvelope(UserEjectedFromMeetingEvtMsg.NAME, routing) val header = BbbClientMsgHeader(UserEjectedFromMeetingEvtMsg.NAME, meetingId, userId) - val body = UserEjectedFromMeetingEvtMsgBody(userId, ejectedBy) + val body = UserEjectedFromMeetingEvtMsgBody(userId, ejectedBy, reason) val event = UserEjectedFromMeetingEvtMsg(header, body) BbbCommonEnvCoreMsg(envelope, event) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/Sender.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/Sender.scala index 67f04f61e9..43ce3bfe42 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/Sender.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core2/message/senders/Sender.scala @@ -1,8 +1,22 @@ package org.bigbluebutton.core2.message.senders -import org.bigbluebutton.common2.msgs.BbbCommonEnvCoreMsg -import org.bigbluebutton.core.OutMessageGateway +import org.bigbluebutton.core.running.OutMsgRouter -trait Sender { +object Sender { + def sendUserEjectedFromMeetingClientEvtMsg(meetingId: String, userId: String, + ejectedBy: String, reason: String, outGW: OutMsgRouter): Unit = { + val ejectFromMeetingClientEvent = MsgBuilder.buildUserEjectedFromMeetingEvtMsg( + meetingId, userId, ejectedBy, reason + ) + outGW.send(ejectFromMeetingClientEvent) + } + + def sendUserEjectedFromMeetingSystemMsg(meetingId: String, userId: String, + ejectedBy: String, outGW: OutMsgRouter): Unit = { + val ejectFromMeetingSystemEvent = MsgBuilder.buildDisconnectClientSysMsg( + meetingId, userId, ejectedBy + ) + outGW.send(ejectFromMeetingSystemEvent) + } } diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala index 7c5a72b650..66ce26cc6f 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/UsersMgs.scala @@ -127,7 +127,7 @@ case class UserEmojiChangedEvtMsgBody(userId: String, emoji: String) */ object UserEjectedFromMeetingEvtMsg { val NAME = "UserEjectedFromMeetingEvtMsg" } case class UserEjectedFromMeetingEvtMsg(header: BbbClientMsgHeader, body: UserEjectedFromMeetingEvtMsgBody) extends StandardMsg -case class UserEjectedFromMeetingEvtMsgBody(userId: String, ejectedBy: String) +case class UserEjectedFromMeetingEvtMsgBody(userId: String, ejectedBy: String, reason: String) object AssignPresenterReqMsg { val NAME = "AssignPresenterReqMsg"} case class AssignPresenterReqMsg(header: BbbClientMsgHeader, body: AssignPresenterReqMsgBody) extends StandardMsg From a548af00f719a5b20b8a57fda1ee67dccf03e9a3 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Wed, 18 Oct 2017 10:11:56 -0700 Subject: [PATCH 27/37] - format --- .../PresentationConversionCompletedSysPubMsgHdlr.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationConversionCompletedSysPubMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationConversionCompletedSysPubMsgHdlr.scala index 6f50a2b9e4..315caf581f 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationConversionCompletedSysPubMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationConversionCompletedSysPubMsgHdlr.scala @@ -55,7 +55,7 @@ trait PresentationConversionCompletedSysPubMsgHdlr { newState match { case Some(ns) => ns - case None => state + case None => state } } From e1b5d6b9f117ca8437c1af668218ec7ff15f49da Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Wed, 18 Oct 2017 18:31:04 +0100 Subject: [PATCH 28/37] Improve screen-sharing view layout and video scaling. --- .../branding/default/style/css/V2Theme.css | 4 - .../components/ScreensharePublishWindow.mxml | 46 +++----- .../components/ScreenshareViewWindow.mxml | 104 +++++++----------- 3 files changed, 56 insertions(+), 98 deletions(-) diff --git a/bigbluebutton-client/branding/default/style/css/V2Theme.css b/bigbluebutton-client/branding/default/style/css/V2Theme.css index e88c63ec1e..679b7727f5 100755 --- a/bigbluebutton-client/branding/default/style/css/V2Theme.css +++ b/bigbluebutton-client/branding/default/style/css/V2Theme.css @@ -767,10 +767,6 @@ mx|DataGrid { //------------------------------ */ -.deskshareControlButtonStyle { - cornerRadius : 18; -} - .deskshareWarningLabelStyle { fontWeight : bold; fontSize : 18; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml index 52461fc6ae..a1a5713e0c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreensharePublishWindow.mxml @@ -343,23 +343,19 @@ with BigBlueButton; if not, see . captureWidth = capWidth; captureHeight = capHeight; - var vidW:Number = captureWidth; - var vidH:Number = captureHeight; + video = new Video(captureWidth, captureHeight); + + // for some reason videoHolder's height is always '0' even when set to 100% so we have to do it manually + video.width=this.width - publishView.getStyle('paddingLeft') - publishView.getStyle('paddingRight') - 10; + video.scaleY=video.scaleX; + if(video.height>this.height - controlBar.height - this.titleBar.height - publishView.getStyle('paddingTop') - publishView.getStyle('paddingBottom') - 10){ + video.height=this.height - controlBar.height - this.titleBar.height - publishView.getStyle('paddingTop') - publishView.getStyle('paddingBottom') - 10; + video.scaleX=video.scaleY; + } + videoWrapper.width = video.width; + videoWrapper.height = video.height; - // for some reason videoHolder's height is always '0' even when set to 100% so we have to do it manually - videoWrapper.height = this.height - controlBar.height - this.titleBar.height - pauseBtn.height - publishView.getStyle('paddingTop') - publishView.getStyle('paddingBottom') - 10; - videoWrapper.width = this.width - publishView.getStyle('paddingLeft') - publishView.getStyle('paddingRight') - 10; - - vidW = videoWrapper.width; - vidH = videoWrapper.width * captureHeight / captureWidth; - - if (vidH > videoWrapper.height) { - vidH = videoWrapper.height; - vidW = videoWrapper.height * captureWidth / captureHeight; - } - - LOGGER.debug("deskshare preview[" + captureWidth + "," + captureHeight + "][" + vidW + "," + vidH + "]"); - video = new Video(vidW, vidH); + LOGGER.debug("deskshare preview[" + captureWidth + "," + captureHeight + "][" + video.width + "," + video.height + "]"); videoWrapper.addChild(video); video.x = videoWrapper.width/2 - video.width/2; @@ -377,8 +373,9 @@ with BigBlueButton; if not, see . pauseBox.visible = pauseBox.includeInLayout = false; videoWrapper.visible = videoWrapper.includeInLayout = true; - pauseBox.width = vidW; - pauseBox.height = vidH; + + pauseBox.width = videoWrapper.width; + pauseBox.height = videoWrapper.height; } public function onMetaData(info:Object):void{ @@ -586,20 +583,11 @@ with BigBlueButton; if not, see . - + - - @@ -619,6 +607,8 @@ with BigBlueButton; if not, see . + + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreenshareViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreenshareViewWindow.mxml index d4165714c7..46db2ca82b 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreenshareViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/ScreenshareViewWindow.mxml @@ -27,13 +27,14 @@ width="100%" height="400" initialize="init()" + layout="absolute" creationComplete="onCreationComplete()" implements="org.bigbluebutton.common.IBbbModuleWindow" xmlns:mate="http://mate.asfusion.com/" title="{ ResourceUtil.getInstance().getString('bbb.screenshareView.title') }" showCloseButton="false" resize="fitToWindow()"> - + @@ -42,6 +43,7 @@ this.height - VIDEO_HEIGHT_PADDING){ + video.height=this.height - VIDEO_HEIGHT_PADDING; + video.scaleX=video.scaleY; } + videoHolder.width = video.width; + videoHolder.height = video.height; + + videoCanvas.verticalScrollPolicy = ScrollPolicy.OFF; + videoCanvas.horizontalScrollPolicy = ScrollPolicy.OFF; } private function fitWindowToVideo():void { @@ -269,33 +256,12 @@ videoHolder.width = videoWidth; video.height = videoHeight; videoHolder.height = videoHeight; - this.height = videoHeight + VIDEO_HEIGHT_PADDING; - this.width = videoWidth + VIDEO_WIDTH_PADDING; } private function videoIsSmallerThanWindow():Boolean { return (videoHeight < this.height) && (videoWidth < this.width); } - - private function fitToWidthAndAdjustHeightToMaintainAspectRatio():void { - video.width = this.width - VIDEO_WIDTH_PADDING; - videoHolder.width = video.width; - // Maintain aspect-ratio - video.height = (videoHeight * video.width) / videoWidth; - videoHolder.height = video.height; - this.height = video.height + VIDEO_HEIGHT_PADDING; - } - - private function fitToHeightAndAdjustWidthToMaintainAspectRatio():void { - video.height = this.height - VIDEO_HEIGHT_PADDING; - videoHolder.height = video.height; - // Maintain aspect-ratio - video.width = (videoWidth * video.height) / videoHeight; - videoHolder.width = video.width; - this.width = video.width + VIDEO_WIDTH_PADDING; - } - /** * resizes the desktop sharing video to actual video resolution */ @@ -308,6 +274,9 @@ video.height = videoHeight; videoHolder.height = videoHeight; } + + videoCanvas.verticalScrollPolicy = ScrollPolicy.AUTO; + videoCanvas.horizontalScrollPolicy = ScrollPolicy.AUTO; } private function determineHowToDisplayVideo():void { @@ -354,17 +323,20 @@ ]]> - - - + + + + + + From ec48b1ec2d7b2a3a095a4fadf906c57fd45ef7ac Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 19 Oct 2017 15:51:58 +0100 Subject: [PATCH 29/37] Display join audio window if back from breakout room. --- .../src/org/bigbluebutton/core/model/Me.as | 5 +++-- .../bigbluebutton/main/model/users/BreakoutRoom.as | 9 +++++++++ .../modules/users/services/MessageReceiver.as | 7 +++++++ .../modules/users/views/JoinBreakoutRoomWindow.mxml | 11 +++++++++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as b/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as index 9324ab8d6c..ff3b9a979b 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as +++ b/bigbluebutton-client/src/org/bigbluebutton/core/model/Me.as @@ -52,7 +52,8 @@ package org.bigbluebutton.core.model public var authTokenValid: Boolean = false; public var waitingForApproval: Boolean; - + public var breakoutEjectFromAudio : Boolean = false; + private var _role:String = "viewer"; public function get role():String { return _role.toUpperCase(); @@ -84,7 +85,7 @@ package org.bigbluebutton.core.model public function myCamSettings():ArrayCollection { return _myCamSettings; } - + public function applyLockSettings():void { var lockSettings:LockSettingsVO = UsersUtil.getLockSettings(); var amNotModerator:Boolean = !UsersUtil.amIModerator(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as index 21516c08fd..04aa659826 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/BreakoutRoom.as @@ -61,6 +61,15 @@ package org.bigbluebutton.main.model.users { removeUser(user.id); users.addItem(user); } + + public function hasUserWithId(userId:String) : Boolean { + for (var i : int = 0; i < users.length; i++) { + if (BreakoutUser(users.getItemAt(i)).id.indexOf(userId) > -1 ) { + return true; + } + } + return false; + } public function removeUser(id: String): void { for (var i: int = 0; i < users.length; i++) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as index 1f3c57fd83..639ae1a979 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as @@ -51,6 +51,7 @@ package org.bigbluebutton.modules.users.services import org.bigbluebutton.main.model.users.events.ChangeMyRole; import org.bigbluebutton.main.model.users.events.StreamStartedEvent; import org.bigbluebutton.main.model.users.events.StreamStoppedEvent; + import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent; import org.bigbluebutton.modules.screenshare.events.WebRTCViewStreamEvent; import org.bigbluebutton.modules.users.events.MeetingMutedEvent; @@ -810,6 +811,12 @@ package org.bigbluebutton.modules.users.services var body: Object = msg.body as Object; var breakoutId: String = body.breakoutId as String; + // Display audio join window + if (LiveMeeting.inst().me.breakoutEjectFromAudio && LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId).hasUserWithId(LiveMeeting.inst().me.id)) { + LiveMeeting.inst().me.breakoutEjectFromAudio = false; + dispatcher.dispatchEvent(new AudioSelectionWindowEvent(AudioSelectionWindowEvent.SHOW_AUDIO_SELECTION)); + } + switchUserFromBreakoutToMainVoiceConf(breakoutId); var breakoutRoom: BreakoutRoom = LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId); LiveMeeting.inst().breakoutRooms.removeBreakoutRoom(breakoutId); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml index 1e68d2f5e3..9d0ade9e05 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/JoinBreakoutRoomWindow.mxml @@ -31,10 +31,11 @@ with BigBlueButton; if not, see . . } protected function joinButtonClickHandler(event:MouseEvent):void { + if (LiveMeeting.inst().me.inVoiceConf) { + LiveMeeting.inst().me.breakoutEjectFromAudio = true; + } else { + LiveMeeting.inst().me.breakoutEjectFromAudio = false; + + } dispatcher.dispatchEvent(new LeaveVoiceConferenceCommand()); dispatcher.dispatchEvent(new StopBroadcastEvent()); navigateToURL(new URLRequest(this.joinUrl), "_blank"); From b447d18b04feffe9b1c111d7fb2d3f9d3d366e5e Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Thu, 19 Oct 2017 15:59:01 +0100 Subject: [PATCH 30/37] Invalidate 'breakoutEjectFromAudio' state if the join audio button is pressed. --- .../org/bigbluebutton/main/views/MainApplicationShell.mxml | 2 +- .../modules/phone/views/components/ToolbarButton.mxml | 1 + .../bigbluebutton/modules/users/services/MessageReceiver.as | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index b4af325d64..587fe449a9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -150,10 +150,10 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.phone.events.WebRTCEchoTestEvent; import org.bigbluebutton.modules.phone.events.WebRTCMediaEvent; import org.bigbluebutton.modules.phone.models.PhoneOptions; - import org.bigbluebutton.util.browser.BrowserCheck; import org.bigbluebutton.modules.users.model.UsersOptions; import org.bigbluebutton.modules.users.views.BreakoutRoomSettings; import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent; + import org.bigbluebutton.util.browser.BrowserCheck; import org.bigbluebutton.util.i18n.ResourceUtil; private static const LOGGER:ILogger = getClassLogger(MainApplicationShell); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml index 39b716c527..f811c5ac01 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/views/components/ToolbarButton.mxml @@ -113,6 +113,7 @@ with BigBlueButton; if not, see . } private function joinAudio():void { + LiveMeeting.inst().me.breakoutEjectFromAudio = false; if (phoneOptions.skipCheck || disableMyMic || defaultListenOnlyMode) { var command:JoinVoiceConferenceCommand = new JoinVoiceConferenceCommand(); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as index 639ae1a979..1100f5c2ca 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/services/MessageReceiver.as @@ -812,7 +812,10 @@ package org.bigbluebutton.modules.users.services var breakoutId: String = body.breakoutId as String; // Display audio join window - if (LiveMeeting.inst().me.breakoutEjectFromAudio && LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId).hasUserWithId(LiveMeeting.inst().me.id)) { + if (LiveMeeting.inst().me.breakoutEjectFromAudio && + LiveMeeting.inst().breakoutRooms.getBreakoutRoom(breakoutId).hasUserWithId(LiveMeeting.inst().me.id) && + !LiveMeeting.inst().me.inVoiceConf + ) { LiveMeeting.inst().me.breakoutEjectFromAudio = false; dispatcher.dispatchEvent(new AudioSelectionWindowEvent(AudioSelectionWindowEvent.SHOW_AUDIO_SELECTION)); } From a3530cad9166e57a17d38409e60f9908ac6dfe9a Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 19 Oct 2017 12:59:14 -0700 Subject: [PATCH 31/37] - remove for now as sometimes when reconnect occurs while there is only one user in the voice conference and the meeting is being records, the audio conference fails to record. --- ...rJoinMeetingAfterReconnectReqMsgHdlr.scala | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) mode change 100644 => 100755 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala old mode 100644 new mode 100755 index 43015c26f5..4ec3d3ea04 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala @@ -14,20 +14,24 @@ trait UserJoinMeetingAfterReconnectReqMsgHdlr extends HandlerHelpers with Breako val outGW: OutMsgRouter def handleUserJoinMeetingAfterReconnectReqMsg(msg: UserJoinMeetingAfterReconnectReqMsg, state: MeetingState2x): MeetingState2x = { - val newState = userJoinMeeting(outGW, msg.body.authToken, liveMeeting, state) + /** + * val newState = userJoinMeeting(outGW, msg.body.authToken, liveMeeting, state) + * + * if (liveMeeting.props.meetingProp.isBreakout) { + * updateParentMeetingWithUsers() + * } + * + * // recover voice user + * for { + * vu <- VoiceUsers.recoverVoiceUser(liveMeeting.voiceUsers, msg.body.userId) + * } yield { + * handleUserJoinedVoiceConfEvtMsg(liveMeeting.props.voiceProp.voiceConf, vu.intId, vu.voiceUserId, vu.callingWith, vu.callerName, vu.callerNum, vu.muted, vu.talking) + * } + * + * newState + */ - if (liveMeeting.props.meetingProp.isBreakout) { - updateParentMeetingWithUsers() - } - - // recover voice user - for { - vu <- VoiceUsers.recoverVoiceUser(liveMeeting.voiceUsers, msg.body.userId) - } yield { - handleUserJoinedVoiceConfEvtMsg(liveMeeting.props.voiceProp.voiceConf, vu.intId, vu.voiceUserId, vu.callingWith, vu.callerName, vu.callerNum, vu.muted, vu.talking) - } - - newState + state } } From e01692c40b1a07949835717fba203db72120119d Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 19 Oct 2017 17:18:50 -0700 Subject: [PATCH 32/37] - send voice conf started and destroyed message --- .../core/apps/voice/VoiceApp2x.scala | 3 +- .../voice/VoiceConfRunningEvtMsgHdlr.scala | 15 ++ .../senders/ReceivedJsonMsgHandlerActor.scala | 2 + .../core/running/MeetingActor.scala | 1 + .../FreeswitchConferenceEventListener.java | 217 +++++++++--------- .../voice/IVoiceConferenceService.java | 33 ++- .../voice/events/VoiceConfRunningEvent.java | 32 +++ .../voice/freeswitch/ESLEventListener.java | 17 +- .../freeswitch/VoiceConferenceService.scala | 13 ++ .../common2/msgs/VoiceConfMsgs.scala | 11 +- .../freeswitch/esl/client/inbound/Client.java | 53 +++-- 11 files changed, 250 insertions(+), 147 deletions(-) create mode 100755 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceConfRunningEvtMsgHdlr.scala create mode 100755 akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/events/VoiceConfRunningEvent.java diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp2x.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp2x.scala index 15aff65510..a7f07a4c0a 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp2x.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceApp2x.scala @@ -8,7 +8,8 @@ trait VoiceApp2x extends UserJoinedVoiceConfEvtMsgHdlr with UserLeftVoiceConfEvtMsgHdlr with UserMutedInVoiceConfEvtMsgHdlr with UserTalkingInVoiceConfEvtMsgHdlr - with RecordingStartedVoiceConfEvtMsgHdlr { + with RecordingStartedVoiceConfEvtMsgHdlr + with VoiceConfRunningEvtMsgHdlr { this: MeetingActor => } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceConfRunningEvtMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceConfRunningEvtMsgHdlr.scala new file mode 100755 index 0000000000..6ab49fc36d --- /dev/null +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/voice/VoiceConfRunningEvtMsgHdlr.scala @@ -0,0 +1,15 @@ +package org.bigbluebutton.core.apps.voice + +import org.bigbluebutton.common2.msgs.VoiceConfRunningEvtMsg +import org.bigbluebutton.core.running.{ BaseMeetingActor, LiveMeeting, OutMsgRouter } + +trait VoiceConfRunningEvtMsgHdlr { + this: BaseMeetingActor => + + val liveMeeting: LiveMeeting + val outGW: OutMsgRouter + + def handleVoiceConfRunningEvtMsg(msg: VoiceConfRunningEvtMsg): Unit = { + log.info("Received VoiceConfRunningEvtMsg " + msg.body.running) + } +} diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala index 90c2bb537f..0a12204f2d 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/pubsub/senders/ReceivedJsonMsgHandlerActor.scala @@ -107,6 +107,8 @@ class ReceivedJsonMsgHandlerActor( // Voice case RecordingStartedVoiceConfEvtMsg.NAME => routeVoiceMsg[RecordingStartedVoiceConfEvtMsg](envelope, jsonNode) + case VoiceConfRunningEvtMsg.NAME => + routeVoiceMsg[VoiceConfRunningEvtMsg](envelope, jsonNode) case UserJoinedVoiceConfEvtMsg.NAME => routeVoiceMsg[UserJoinedVoiceConfEvtMsg](envelope, jsonNode) case UserLeftVoiceConfEvtMsg.NAME => diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index a444195df9..674e72e312 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -246,6 +246,7 @@ class MeetingActor( case m: MuteMeetingCmdMsg => handleMuteMeetingCmdMsg(m) case m: UserConnectedToGlobalAudioMsg => handleUserConnectedToGlobalAudioMsg(m) case m: UserDisconnectedFromGlobalAudioMsg => handleUserDisconnectedFromGlobalAudioMsg(m) + case m: VoiceConfRunningEvtMsg => handleVoiceConfRunningEvtMsg(m) // Layout case m: GetCurrentLayoutReqMsg => handleGetCurrentLayoutReqMsg(m) diff --git a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java index 6bdb81c4a4..00e4ad6a24 100755 --- a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java +++ b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/FreeswitchConferenceEventListener.java @@ -1,21 +1,20 @@ /** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 3.0 of the License, or (at your option) any later -* version. -* -* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see . -* -*/ + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + *

+ * Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). + *

+ * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + *

+ * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + *

+ * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + */ package org.bigbluebutton.freeswitch.voice; import java.util.concurrent.BlockingQueue; @@ -24,106 +23,100 @@ import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import org.bigbluebutton.freeswitch.voice.events.ScreenshareStartedEvent; -import org.bigbluebutton.freeswitch.voice.events.DeskShareEndedEvent; -import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener; -import org.bigbluebutton.freeswitch.voice.events.ScreenshareRTMPBroadcastEvent; -import org.bigbluebutton.freeswitch.voice.events.VoiceConferenceEvent; -import org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent; -import org.bigbluebutton.freeswitch.voice.events.VoiceUserJoinedEvent; -import org.bigbluebutton.freeswitch.voice.events.VoiceUserLeftEvent; -import org.bigbluebutton.freeswitch.voice.events.VoiceUserMutedEvent; -import org.bigbluebutton.freeswitch.voice.events.VoiceUserTalkingEvent; +import org.bigbluebutton.freeswitch.voice.events.*; public class FreeswitchConferenceEventListener implements ConferenceEventListener { - private static final int SENDERTHREADS = 1; - private static final Executor msgSenderExec = Executors.newFixedThreadPool(SENDERTHREADS); - private static final Executor runExec = Executors.newFixedThreadPool(SENDERTHREADS); - private BlockingQueue messages = new LinkedBlockingQueue(); + private static final int SENDERTHREADS = 1; + private static final Executor msgSenderExec = Executors.newFixedThreadPool(SENDERTHREADS); + private static final Executor runExec = Executors.newFixedThreadPool(SENDERTHREADS); + private BlockingQueue messages = new LinkedBlockingQueue(); - private volatile boolean sendMessages = false; - private final IVoiceConferenceService vcs; - - public FreeswitchConferenceEventListener(IVoiceConferenceService vcs) { - this.vcs = vcs; - } - - private void queueMessage(VoiceConferenceEvent event) { - try { - messages.offer(event, 5, TimeUnit.SECONDS); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + private volatile boolean sendMessages = false; + private final IVoiceConferenceService vcs; + + public FreeswitchConferenceEventListener(IVoiceConferenceService vcs) { + this.vcs = vcs; + } + + private void queueMessage(VoiceConferenceEvent event) { + try { + messages.offer(event, 5, TimeUnit.SECONDS); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - - private void sendMessageToBigBlueButton(final VoiceConferenceEvent event) { - Runnable task = new Runnable() { - public void run() { - if (event instanceof VoiceUserJoinedEvent) { - VoiceUserJoinedEvent evt = (VoiceUserJoinedEvent) event; - vcs.userJoinedVoiceConf(evt.getRoom(), evt.getVoiceUserId(), evt.getUserId(), evt.getCallerIdName(), - evt.getCallerIdNum(), evt.getMuted(), evt.getSpeaking(), evt.getAvatarURL()); - } else if (event instanceof VoiceUserLeftEvent) { - VoiceUserLeftEvent evt = (VoiceUserLeftEvent) event; - vcs.userLeftVoiceConf(evt.getRoom(), evt.getUserId()); - } else if (event instanceof VoiceUserMutedEvent) { - VoiceUserMutedEvent evt = (VoiceUserMutedEvent) event; - vcs.userMutedInVoiceConf(evt.getRoom(), evt.getUserId(), evt.isMuted()); - } else if (event instanceof VoiceUserTalkingEvent) { - VoiceUserTalkingEvent evt = (VoiceUserTalkingEvent) event; - vcs.userTalkingInVoiceConf(evt.getRoom(), evt.getUserId(), evt.isTalking()); - } else if (event instanceof VoiceStartRecordingEvent) { - VoiceStartRecordingEvent evt = (VoiceStartRecordingEvent) event; - vcs.voiceConfRecordingStarted(evt.getRoom(), evt.getRecordingFilename(), evt.startRecord(), evt.getTimestamp()); - } else if (event instanceof ScreenshareStartedEvent) { - ScreenshareStartedEvent evt = (ScreenshareStartedEvent) event; - vcs.deskShareStarted(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName()); - } else if (event instanceof DeskShareEndedEvent) { - DeskShareEndedEvent evt = (DeskShareEndedEvent) event; - vcs.deskShareEnded(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName()); - } else if (event instanceof ScreenshareRTMPBroadcastEvent) { - if (((ScreenshareRTMPBroadcastEvent) event).getBroadcast()) { - ScreenshareRTMPBroadcastEvent evt = (ScreenshareRTMPBroadcastEvent) event; - vcs.deskShareRTMPBroadcastStarted(evt.getRoom(), evt.getBroadcastingStreamUrl(), - evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp()); - } else { - ScreenshareRTMPBroadcastEvent evt = (ScreenshareRTMPBroadcastEvent) event; - vcs.deskShareRTMPBroadcastStopped(evt.getRoom(), evt.getBroadcastingStreamUrl(), - evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp()); - } - } - } - }; + } - runExec.execute(task); - } + private void sendMessageToBigBlueButton(final VoiceConferenceEvent event) { + Runnable task = new Runnable() { + public void run() { + if (event instanceof VoiceUserJoinedEvent) { + VoiceUserJoinedEvent evt = (VoiceUserJoinedEvent) event; + vcs.userJoinedVoiceConf(evt.getRoom(), evt.getVoiceUserId(), evt.getUserId(), evt.getCallerIdName(), + evt.getCallerIdNum(), evt.getMuted(), evt.getSpeaking(), evt.getAvatarURL()); + } else if (event instanceof VoiceConfRunningEvent) { + VoiceConfRunningEvent evt = (VoiceConfRunningEvent) event; + vcs.voiceConfRunning(evt.getRoom(), evt.isRunning()); + } else if (event instanceof VoiceUserLeftEvent) { + VoiceUserLeftEvent evt = (VoiceUserLeftEvent) event; + vcs.userLeftVoiceConf(evt.getRoom(), evt.getUserId()); + } else if (event instanceof VoiceUserMutedEvent) { + VoiceUserMutedEvent evt = (VoiceUserMutedEvent) event; + vcs.userMutedInVoiceConf(evt.getRoom(), evt.getUserId(), evt.isMuted()); + } else if (event instanceof VoiceUserTalkingEvent) { + VoiceUserTalkingEvent evt = (VoiceUserTalkingEvent) event; + vcs.userTalkingInVoiceConf(evt.getRoom(), evt.getUserId(), evt.isTalking()); + } else if (event instanceof VoiceStartRecordingEvent) { + VoiceStartRecordingEvent evt = (VoiceStartRecordingEvent) event; + vcs.voiceConfRecordingStarted(evt.getRoom(), evt.getRecordingFilename(), evt.startRecord(), evt.getTimestamp()); + } else if (event instanceof ScreenshareStartedEvent) { + ScreenshareStartedEvent evt = (ScreenshareStartedEvent) event; + vcs.deskShareStarted(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName()); + } else if (event instanceof DeskShareEndedEvent) { + DeskShareEndedEvent evt = (DeskShareEndedEvent) event; + vcs.deskShareEnded(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName()); + } else if (event instanceof ScreenshareRTMPBroadcastEvent) { + if (((ScreenshareRTMPBroadcastEvent) event).getBroadcast()) { + ScreenshareRTMPBroadcastEvent evt = (ScreenshareRTMPBroadcastEvent) event; + vcs.deskShareRTMPBroadcastStarted(evt.getRoom(), evt.getBroadcastingStreamUrl(), + evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp()); + } else { + ScreenshareRTMPBroadcastEvent evt = (ScreenshareRTMPBroadcastEvent) event; + vcs.deskShareRTMPBroadcastStopped(evt.getRoom(), evt.getBroadcastingStreamUrl(), + evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp()); + } + } + } + }; - public void start() { - sendMessages = true; - Runnable sender = new Runnable() { - public void run() { - while (sendMessages) { - VoiceConferenceEvent message; - try { - message = messages.take(); - sendMessageToBigBlueButton(message); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - }; - msgSenderExec.execute(sender); - } - - public void stop() { - sendMessages = false; - } - - public void handleConferenceEvent(VoiceConferenceEvent event) { - queueMessage(event); - } + runExec.execute(task); + } + + public void start() { + sendMessages = true; + Runnable sender = new Runnable() { + public void run() { + while (sendMessages) { + VoiceConferenceEvent message; + try { + message = messages.take(); + sendMessageToBigBlueButton(message); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + }; + msgSenderExec.execute(sender); + } + + public void stop() { + sendMessages = false; + } + + public void handleConferenceEvent(VoiceConferenceEvent event) { + queueMessage(event); + } } diff --git a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/IVoiceConferenceService.java b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/IVoiceConferenceService.java index 0f0e2ab687..dd7fb1d13e 100755 --- a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/IVoiceConferenceService.java +++ b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/IVoiceConferenceService.java @@ -1,16 +1,27 @@ package org.bigbluebutton.freeswitch.voice; public interface IVoiceConferenceService { - void voiceConfRecordingStarted(String voiceConfId, String recordStream, Boolean recording, String timestamp); - void userJoinedVoiceConf(String voiceConfId, String voiceUserId, String userId, String callerIdName, - String callerIdNum, Boolean muted, Boolean speaking, String avatarURL); - void userLeftVoiceConf(String voiceConfId, String voiceUserId); - void userLockedInVoiceConf(String voiceConfId, String voiceUserId, Boolean locked); - void userMutedInVoiceConf(String voiceConfId, String voiceUserId, Boolean muted); - void userTalkingInVoiceConf(String voiceConfId, String voiceUserId, Boolean talking); - void deskShareStarted(String voiceConfId, String callerIdNum, String callerIdName); - void deskShareEnded(String voiceConfId, String callerIdNum, String callerIdName); - void deskShareRTMPBroadcastStarted(String room, String streamname, Integer videoWidth, Integer videoHeight, String timestamp); - void deskShareRTMPBroadcastStopped(String room, String streamname, Integer videoWidth, Integer videoHeight, String timestamp); + void voiceConfRecordingStarted(String voiceConfId, String recordStream, Boolean recording, String timestamp); + + void voiceConfRunning(String voiceConfId, Boolean running); + + void userJoinedVoiceConf(String voiceConfId, String voiceUserId, String userId, String callerIdName, + String callerIdNum, Boolean muted, Boolean speaking, String avatarURL); + + void userLeftVoiceConf(String voiceConfId, String voiceUserId); + + void userLockedInVoiceConf(String voiceConfId, String voiceUserId, Boolean locked); + + void userMutedInVoiceConf(String voiceConfId, String voiceUserId, Boolean muted); + + void userTalkingInVoiceConf(String voiceConfId, String voiceUserId, Boolean talking); + + void deskShareStarted(String voiceConfId, String callerIdNum, String callerIdName); + + void deskShareEnded(String voiceConfId, String callerIdNum, String callerIdName); + + void deskShareRTMPBroadcastStarted(String room, String streamname, Integer videoWidth, Integer videoHeight, String timestamp); + + void deskShareRTMPBroadcastStopped(String room, String streamname, Integer videoWidth, Integer videoHeight, String timestamp); } diff --git a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/events/VoiceConfRunningEvent.java b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/events/VoiceConfRunningEvent.java new file mode 100755 index 0000000000..1bdfe45572 --- /dev/null +++ b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/events/VoiceConfRunningEvent.java @@ -0,0 +1,32 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + *

+ * Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). + *

+ * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + *

+ * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + *

+ * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + */ +package org.bigbluebutton.freeswitch.voice.events; + +public class VoiceConfRunningEvent extends VoiceConferenceEvent { + + private boolean running; + + public VoiceConfRunningEvent(String room, boolean running) { + super(room); + this.running = running; + } + + public boolean isRunning() { + return running; + } +} diff --git a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java index b3ef985beb..87f2aad2e6 100755 --- a/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java +++ b/akka-bbb-fsesl/src/main/java/org/bigbluebutton/freeswitch/voice/freeswitch/ESLEventListener.java @@ -18,6 +18,8 @@ public class ESLEventListener implements IEslEventListener { private static final String STOP_TALKING_EVENT = "stop-talking"; private static final String START_RECORDING_EVENT = "start-recording"; private static final String STOP_RECORDING_EVENT = "stop-recording"; + private static final String CONFERENCE_CREATED_EVENT = "conference-create"; + private static final String CONFERENCE_DESTROYED_EVENT = "conference-destroy"; private static final String SCREENSHARE_CONFERENCE_NAME_SUFFIX = "-SCREENSHARE"; @@ -119,19 +121,24 @@ public class ESLEventListener implements IEslEventListener { @Override public void conferenceEventAction(String uniqueId, String confName, int confSize, String action, EslEvent event) { - Integer memberId = this.getMemberIdFromEvent(event); - VoiceUserTalkingEvent pt; - if (action == null) { return; } if (action.equals(START_TALKING_EVENT)) { - pt = new VoiceUserTalkingEvent(memberId.toString(), confName, true); + Integer memberId = this.getMemberIdFromEvent(event); + VoiceUserTalkingEvent pt = new VoiceUserTalkingEvent(memberId.toString(), confName, true); conferenceEventListener.handleConferenceEvent(pt); } else if (action.equals(STOP_TALKING_EVENT)) { - pt = new VoiceUserTalkingEvent(memberId.toString(), confName, false); + Integer memberId = this.getMemberIdFromEvent(event); + VoiceUserTalkingEvent pt = new VoiceUserTalkingEvent(memberId.toString(), confName, false); conferenceEventListener.handleConferenceEvent(pt); + } else if (action.equals(CONFERENCE_CREATED_EVENT)) { + VoiceConfRunningEvent pt = new VoiceConfRunningEvent(confName, true); + conferenceEventListener.handleConferenceEvent(pt); + } else if (action.equals(CONFERENCE_DESTROYED_EVENT)) { + VoiceConfRunningEvent pt = new VoiceConfRunningEvent(confName, false); + conferenceEventListener.handleConferenceEvent(pt); } else { System.out.println("Unknown conference Action [" + action + "]"); } diff --git a/akka-bbb-fsesl/src/main/scala/org/bigbluebutton/freeswitch/VoiceConferenceService.scala b/akka-bbb-fsesl/src/main/scala/org/bigbluebutton/freeswitch/VoiceConferenceService.scala index b00b3acea2..909c25a4c2 100755 --- a/akka-bbb-fsesl/src/main/scala/org/bigbluebutton/freeswitch/VoiceConferenceService.scala +++ b/akka-bbb-fsesl/src/main/scala/org/bigbluebutton/freeswitch/VoiceConferenceService.scala @@ -23,6 +23,19 @@ class VoiceConferenceService(sender: RedisPublisher) extends IVoiceConferenceSer } + def voiceConfRunning(voiceConfId: String, running: java.lang.Boolean): Unit = { + println("*************######## Conference voiceConfId=" + voiceConfId + " running=" + running) + val header = BbbCoreVoiceConfHeader(VoiceConfRunningEvtMsg.NAME, voiceConfId) + val body = VoiceConfRunningEvtMsgBody(voiceConfId, running.booleanValue()) + val envelope = BbbCoreEnvelope(VoiceConfRunningEvtMsg.NAME, Map("voiceConf" -> voiceConfId)) + + val msg = new VoiceConfRunningEvtMsg(header, body) + val msgEvent = BbbCommonEnvCoreMsg(envelope, msg) + + val json = JsonUtil.toJson(msgEvent) + sender.publish(fromVoiceConfRedisChannel, json) + } + def userJoinedVoiceConf(voiceConfId: String, voiceUserId: String, userId: String, callerIdName: String, callerIdNum: String, muted: java.lang.Boolean, talking: java.lang.Boolean, avatarURL: String) { diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/VoiceConfMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/VoiceConfMsgs.scala index d2de5ec711..9521dad5fd 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/VoiceConfMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/VoiceConfMsgs.scala @@ -228,6 +228,15 @@ case class MeetingMutedEvtMsgBody(muted: Boolean, mutedBy: String) callerNum: String, muted: Boolean, talking: Boolean, callingWith: String, listenOnly: Boolean) +/** + * Received from FS about the conference is running (created, destroyed). + */ +object VoiceConfRunningEvtMsg { val NAME = "VoiceConfRunningEvtMsg" } +case class VoiceConfRunningEvtMsg(header: BbbCoreVoiceConfHeader, + body: VoiceConfRunningEvtMsgBody) extends VoiceStandardMsg +case class VoiceConfRunningEvtMsgBody(voiceConf: String, running: Boolean) + + /** * Received from FS that user has left the voice conference. */ @@ -305,4 +314,4 @@ case class UserConnectedToGlobalAudioMsgBody(userId: String, name: String) object UserDisconnectedFromGlobalAudioMsg { val NAME = "UserDisconnectedFromGlobalAudioMsg" } case class UserDisconnectedFromGlobalAudioMsg(header: BbbCoreVoiceConfHeader, body: UserDisconnectedFromGlobalAudioMsgBody) extends VoiceStandardMsg -case class UserDisconnectedFromGlobalAudioMsgBody(userId: String, name: String) \ No newline at end of file +case class UserDisconnectedFromGlobalAudioMsgBody(userId: String, name: String) diff --git a/bbb-fsesl-client/src/main/java/org/freeswitch/esl/client/inbound/Client.java b/bbb-fsesl-client/src/main/java/org/freeswitch/esl/client/inbound/Client.java index 577aa36f64..482067ed8e 100755 --- a/bbb-fsesl-client/src/main/java/org/freeswitch/esl/client/inbound/Client.java +++ b/bbb-fsesl-client/src/main/java/org/freeswitch/esl/client/inbound/Client.java @@ -25,7 +25,7 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; - +import java.util.Iterator; import org.freeswitch.esl.client.IEslEventListener; import org.freeswitch.esl.client.internal.IEslProtocolListener; import org.freeswitch.esl.client.transport.CommandResponse; @@ -461,18 +461,36 @@ public class Client String eventFunc = eventHeaders.get("Event-Calling-Function"); String uniqueId = eventHeaders.get("Caller-Unique-ID"); String confName = eventHeaders.get("Conference-Name"); + String eventAction = eventHeaders.get("Action"); int confSize = Integer.parseInt(eventHeaders.get("Conference-Size")); +/** + StringBuilder sb = new StringBuilder(""); + sb.append("\n"); + for (Iterator it = eventHeaders.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Map.Entry)it.next(); + sb.append(entry.getKey()); + sb.append(" => '"); + sb.append(entry.getValue()); + sb.append("'\n"); + } - //FIXME: all by Action eventHeader really.... maybe? - // But this way we filter whole sections of Action events - if (eventFunc == null) { + System.out.println("##### Received Event for " + confName); + System.out.println("##### " + sb.toString()); +**/ + if (eventFunc == null || eventAction == null) { //Noop... + } else if (eventAction.equals("conference-create")) { + listener.conferenceEventAction(uniqueId, confName, confSize, eventAction, event); + return; + } else if (eventAction.equals("conference-destroy")) { + listener.conferenceEventAction(uniqueId, confName, confSize, eventAction, event); + return; } else if (eventFunc.equals("conference_thread_run")) { - System.out.println("##### Client conference_thread_run"); + System.out.println("##### Client conference_thread_run"); listener.conferenceEventThreadRun(uniqueId, confName, confSize, event); return; } else if (eventFunc.equals("member_add_file_data")) { - System.out.println("##### Client member_add_file_data"); + System.out.println("##### Client member_add_file_data"); listener.conferenceEventPlayFile(uniqueId, confName, confSize, event); return; } else if (eventFunc.equals("conf_api_sub_transfer") || eventFunc.equals("conference_api_sub_transfer")) { @@ -480,11 +498,11 @@ public class Client listener.conferenceEventTransfer(uniqueId, confName, confSize, event); return; } else if (eventFunc.equals("conference_add_member") || eventFunc.equals("conference_member_add")) { - System.out.println("##### Client conference_add_member"); + System.out.println("##### Client conference_add_member"); listener.conferenceEventJoin(uniqueId, confName, confSize, event); return; } else if (eventFunc.equals("conference_del_member") || eventFunc.equals("conference_member_del")) { - System.out.println("##### Client conference_del_member"); + System.out.println("##### Client conference_del_member"); listener.conferenceEventLeave(uniqueId, confName, confSize, event); return; } else if (eventFunc.equals("conf_api_sub_mute") || eventFunc.equals("conference_api_sub_mute")) { @@ -494,19 +512,20 @@ public class Client listener.conferenceEventUnMute(uniqueId, confName, confSize, event); return; } else if (eventFunc.equals("conference_record_thread_run")) { - System.out.println("##### Client conference_record_thread_run"); + System.out.println("##### Client conference_record_thread_run"); listener.conferenceEventRecord(uniqueId, confName, confSize, event); return; } else if (eventFunc.equals("conference_loop_input")) { - listener.conferenceEventAction(uniqueId, confName, confSize, eventHeaders.get("Action"), event); + listener.conferenceEventAction(uniqueId, confName, confSize, eventAction, event); return; } else if (eventFunc.equals("stop_talking_handler")) { - listener.conferenceEventAction(uniqueId, confName, confSize, eventHeaders.get("Action"), event); + listener.conferenceEventAction(uniqueId, confName, confSize, eventAction, event); return; - } else { - /* StringBuilder sb = new StringBuilder(""); + } else { + /** + StringBuilder sb = new StringBuilder(""); sb.append("\n"); - for (Iterator it=eventHeaders.entrySet().iterator(); it.hasNext(); ) { + for (Iterator it = eventHeaders.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry)it.next(); sb.append(entry.getKey()); sb.append(" => '"); @@ -514,11 +533,11 @@ public class Client sb.append("'\n"); } log.info ("Unknown Conference Event [{}] [{}]", confName, sb.toString()); - */ + System.out.println("##### unhandled Event for " + confName); + System.out.println("##### " + sb.toString()); + **/ } } - - listener.eventReceived( event ); } catch ( Throwable t ) { log.error( "Error caught notifying listener of event [" + event + ']', t ); From f3ba3e5ac96bb08234b57ecfb7f49f6e44bd76d9 Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Fri, 20 Oct 2017 11:17:19 +0100 Subject: [PATCH 33/37] Clean ununsed options properties and classes. --- .../resources/config.xml.template | 6 ++-- .../modules/BigBlueButtonModuleLoader.as | 30 ------------------- .../main/model/modules/ModuleDescriptor.as | 4 +-- .../model/options/BrowserVersionsOptions.as | 3 -- .../main/model/options/SkinningOptions.as | 3 -- .../modules/caption/model/CaptionOptions.as | 18 +++++++++++ 6 files changed, 23 insertions(+), 41 deletions(-) delete mode 100755 bigbluebutton-client/src/org/bigbluebutton/main/model/modules/BigBlueButtonModuleLoader.as diff --git a/bigbluebutton-client/resources/config.xml.template b/bigbluebutton-client/resources/config.xml.template index 80dfc62564..b8b7dee46c 100755 --- a/bigbluebutton-client/resources/config.xml.template +++ b/bigbluebutton-client/resources/config.xml.template @@ -8,10 +8,10 @@ - + - - + + . -* -*/ -package org.bigbluebutton.main.model.modules -{ - import mx.modules.ModuleLoader; - - public class BigBlueButtonModuleLoader extends ModuleLoader - { - public function BigBlueButtonModuleLoader() - { - super(); - } - } -} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/modules/ModuleDescriptor.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/modules/ModuleDescriptor.as index e73f43a79f..dcc1a04b73 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/modules/ModuleDescriptor.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/modules/ModuleDescriptor.as @@ -38,7 +38,7 @@ package org.bigbluebutton.main.model.modules private static const LOGGER:ILogger = getClassLogger(ModuleDescriptor); private var _attributes:Object; - private var _loader:BigBlueButtonModuleLoader; + private var _loader:ModuleLoader; private var _module:IBigBlueButtonModule; private var _loaded:Boolean = false; private var _connected:Boolean = false; @@ -53,7 +53,7 @@ package org.bigbluebutton.main.model.modules { unresolvedDependancies = new ArrayCollection(); _attributes = new Object(); - _loader = new BigBlueButtonModuleLoader(); + _loader = new ModuleLoader(); parseAttributes(attributes); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/options/BrowserVersionsOptions.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/options/BrowserVersionsOptions.as index b3d1b34acd..6b0e782620 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/options/BrowserVersionsOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/options/BrowserVersionsOptions.as @@ -30,9 +30,6 @@ package org.bigbluebutton.main.model.options { [Bindable] public var flash:String = ""; - [Bindable] - public var java:String = ""; - public function BrowserVersionsOptions() { name = "browserVersions"; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/options/SkinningOptions.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/options/SkinningOptions.as index d5c331b2f4..5dd95ddd2c 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/main/model/options/SkinningOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/options/SkinningOptions.as @@ -21,9 +21,6 @@ package org.bigbluebutton.main.model.options { public class SkinningOptions extends Options { - [Bindable] - public var enabled:Boolean = true; - [Bindable] public var url:String = ""; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/caption/model/CaptionOptions.as b/bigbluebutton-client/src/org/bigbluebutton/modules/caption/model/CaptionOptions.as index dc33205126..f6aa186e6d 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/caption/model/CaptionOptions.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/caption/model/CaptionOptions.as @@ -1,3 +1,21 @@ +/** + * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ + * + * Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below). + * + * This program is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3.0 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, see . + * + */ package org.bigbluebutton.modules.caption.model { import org.bigbluebutton.core.Options; From bd1e8a0f088f529b7de7ab620949fd3560af6dd0 Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Fri, 20 Oct 2017 15:37:38 +0100 Subject: [PATCH 34/37] Remove trailing spaces in config.xml.template --- .../resources/config.xml.template | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bigbluebutton-client/resources/config.xml.template b/bigbluebutton-client/resources/config.xml.template index b8b7dee46c..0ddab1bbc7 100755 --- a/bigbluebutton-client/resources/config.xml.template +++ b/bigbluebutton-client/resources/config.xml.template @@ -10,7 +10,7 @@ - + - + - + - + - + - + - + - + --> - + From 333dba585bf4730381db94d6fbf418b4384c9105 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 19 Oct 2017 12:59:14 -0700 Subject: [PATCH 35/37] - remove for now as sometimes when reconnect occurs while there is only one user in the voice conference and the meeting is being records, the audio conference fails to record. --- ...rJoinMeetingAfterReconnectReqMsgHdlr.scala | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) mode change 100644 => 100755 akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala old mode 100644 new mode 100755 index 43015c26f5..4ec3d3ea04 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/users/UserJoinMeetingAfterReconnectReqMsgHdlr.scala @@ -14,20 +14,24 @@ trait UserJoinMeetingAfterReconnectReqMsgHdlr extends HandlerHelpers with Breako val outGW: OutMsgRouter def handleUserJoinMeetingAfterReconnectReqMsg(msg: UserJoinMeetingAfterReconnectReqMsg, state: MeetingState2x): MeetingState2x = { - val newState = userJoinMeeting(outGW, msg.body.authToken, liveMeeting, state) + /** + * val newState = userJoinMeeting(outGW, msg.body.authToken, liveMeeting, state) + * + * if (liveMeeting.props.meetingProp.isBreakout) { + * updateParentMeetingWithUsers() + * } + * + * // recover voice user + * for { + * vu <- VoiceUsers.recoverVoiceUser(liveMeeting.voiceUsers, msg.body.userId) + * } yield { + * handleUserJoinedVoiceConfEvtMsg(liveMeeting.props.voiceProp.voiceConf, vu.intId, vu.voiceUserId, vu.callingWith, vu.callerName, vu.callerNum, vu.muted, vu.talking) + * } + * + * newState + */ - if (liveMeeting.props.meetingProp.isBreakout) { - updateParentMeetingWithUsers() - } - - // recover voice user - for { - vu <- VoiceUsers.recoverVoiceUser(liveMeeting.voiceUsers, msg.body.userId) - } yield { - handleUserJoinedVoiceConfEvtMsg(liveMeeting.props.voiceProp.voiceConf, vu.intId, vu.voiceUserId, vu.callingWith, vu.callerName, vu.callerNum, vu.muted, vu.talking) - } - - newState + state } } From 1968756f738d267dd1da56852adfc37492bd0f19 Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Fri, 20 Oct 2017 08:35:50 -0700 Subject: [PATCH 36/37] - update fsesl lib jar version --- akka-bbb-fsesl/build.sbt | 2 +- bbb-fsesl-client/build.sbt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/akka-bbb-fsesl/build.sbt b/akka-bbb-fsesl/build.sbt index ce59af4358..36275f0e26 100755 --- a/akka-bbb-fsesl/build.sbt +++ b/akka-bbb-fsesl/build.sbt @@ -53,7 +53,7 @@ libraryDependencies ++= { libraryDependencies += "org.bigbluebutton" % "bbb-common-message_2.12" % "0.0.19-SNAPSHOT" -libraryDependencies += "org.bigbluebutton" % "bbb-fsesl-client" % "0.0.5" +libraryDependencies += "org.bigbluebutton" % "bbb-fsesl-client" % "0.0.6" // https://mvnrepository.com/artifact/org.scala-lang/scala-library libraryDependencies += "org.scala-lang" % "scala-library" % "2.12.2" diff --git a/bbb-fsesl-client/build.sbt b/bbb-fsesl-client/build.sbt index 8e67c00bd5..4f9019d308 100755 --- a/bbb-fsesl-client/build.sbt +++ b/bbb-fsesl-client/build.sbt @@ -6,7 +6,7 @@ description := "BigBlueButton custom FS-ESL client built on top of FS-ESL Java l organization := "org.bigbluebutton" -version := "0.0.5" +version := "0.0.6" // We want to have our jar files in lib_managed dir. // This way we'll have the right path when we import From 78f9fd841aa765b96b23f99906fb24c0ac61d391 Mon Sep 17 00:00:00 2001 From: Ghazi Triki Date: Fri, 20 Oct 2017 16:53:42 +0100 Subject: [PATCH 37/37] Update Flex SDK docs for 2.1 --- DEVELOPMENT.md | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 1476a8a9f4..23e93e4efc 100755 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -290,3 +290,104 @@ Handle the message in [MeestingActor](https://github.com/bigbluebutton/bigbluebu A complete example would be the `ValidateAuthTokenReqMsg`. +## Installing Flex SDK 4.16.0 and Playerglobal 23.0 for version 2.1 development + +In the next step, you need to get the Apache Flex 4.16.0 SDK package. + +Next, you need to make a directory to hold the tools needed for BigBlueButton development. + +~~~ +mkdir -p ~/dev/tools +cd ~/dev/tools +~~~ + +First, you need to download the SDK tarball from an Apache mirror site and then unpack it. + +~~~ +wget https://archive.apache.org/dist/flex/4.16.0/binaries/apache-flex-sdk-4.16.0-bin.tar.gz +tar xvfz apache-flex-sdk-4.16.0-bin.tar.gz +~~~ + +Next, create a linked directory with a shortened name for easier referencing. + +~~~ +ln -s ~/dev/tools/apache-flex-sdk-4.16.0-bin ~/dev/tools/flex +~~~ + +Once the Apache Flex SDK is unpacked, you need to download one of the dependencies manually because the file was moved from its original URL. + +~~~ +wget --content-disposition https://github.com/swfobject/swfobject/archive/2.2.tar.gz +tar xvfz swfobject-2.2.tar.gz +cp -r swfobject-2.2/swfobject flex/templates/ +~~~ + +Now that we've finished with the first dependency we need to download the Adobe Flex SDK. We'll do this step manually in case the download fails (if it does, remove the incomplete file and issue the `wget` command again). + +~~~ +cd flex/ +mkdir -p in/ +wget http://download.macromedia.com/pub/flex/sdk/builds/flex4.6/flex_sdk_4.6.0.23201B.zip -P in/ +~~~ + +Once the supplementary SDK has downloaded, we can use its `build.xml` script to automatically download the remaining third-party tools. + +~~~ +ant -f frameworks/build.xml thirdparty-downloads +~~~ + +After Flex downloads the remaining third-party tools, you need to modify their permissions. + +~~~ +find ~/dev/tools/flex -type d -exec chmod o+rx '{}' \; +chmod 755 ~/dev/tools/flex/bin/* +chmod -R +r ~/dev/tools/flex +~~~ + +The next step in setting up the Flex SDK environment is to download a Flex library for video. + +~~~ +mkdir -p ~/dev/tools/flex/frameworks/libs/player/23.0 +cd ~/dev/tools/flex/frameworks/libs/player/23.0 +wget http://fpdownload.macromedia.com/get/flashplayer/installers/archive/playerglobal/playerglobal23_0.swc +mv -f playerglobal23_0.swc playerglobal.swc +~~~ + +The last step to have a working Flex SDK is to configure it to work with playerglobal 23.0 + +~~~ +cd ~/dev/tools/flex +sed -i "s/11.1/23.0/g" frameworks/flex-config.xml +sed -i "s/14<\/swf-version>/34<\/swf-version>/g" frameworks/flex-config.xml +sed -i "s/{playerglobalHome}\/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/libs\/player\/23.0/g" frameworks/flex-config.xml +~~~ + +With the tools installed, you need to add a set of environment variables to your `.profile` to access these tools. + +~~~ +vi ~/.profile +~~~ + +Copy-and-paste the following text at bottom of `.profile`. + +~~~ + +export FLEX_HOME=$HOME/dev/tools/flex +export PATH=$PATH:$FLEX_HOME/bin + +export ANT_OPTS="-Xmx512m -XX:MaxPermSize=512m" + +~~~ + +Reload your profile to use these tools (this will happen automatically when you next login). + +~~~ +source ~/.profile +~~~ + +Check that the tools are now in your path by running the following command. + +~~~ +$ mxmlc -version +Version 4.16.0 build 20170305 +~~~