From ee560bf18890edfac24bf11952dba393abcabd05 Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Mon, 15 Aug 2022 17:25:45 -0300 Subject: [PATCH 1/4] Makes meeting-ended and error-screen show ejectedReason message --- .../imports/ui/components/app/container.jsx | 7 ++++--- .../imports/ui/components/error-screen/component.jsx | 3 +++ .../imports/ui/components/meeting-ended/component.jsx | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx index 887fe68398..d1d9050ffb 100755 --- a/bigbluebutton-html5/imports/ui/components/app/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx @@ -45,8 +45,9 @@ const intlMessages = defineMessages({ }, }); -const endMeeting = (code) => { +const endMeeting = (code, ejectedReason) => { Session.set('codeError', code); + Session.set('errorMessageDescription', ejectedReason); Session.set('isMeetingEnded', true); }; @@ -189,8 +190,8 @@ const currentUserEmoji = (currentUser) => (currentUser export default injectIntl(withModalMounter(withTracker(({ intl, baseControls }) => { Users.find({ userId: Auth.userID, meetingId: Auth.meetingID }).observe({ - removed() { - endMeeting('403'); + removed(userData) { + endMeeting(403, userData.ejectedReason || null); }, }); diff --git a/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx b/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx index 619337f07d..24f24ca5c7 100644 --- a/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx @@ -43,6 +43,9 @@ const intlMessages = defineMessages({ joined_another_window_reason: { id: 'app.error.joinedAnotherWindow', }, + user_inactivity_eject_reason: { + id: 'app.meeting.logout.userInactivityEjectReason', + }, }); const propTypes = { diff --git a/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx b/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx index 251d0156be..307e6a4944 100755 --- a/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/meeting-ended/component.jsx @@ -179,7 +179,7 @@ class MeetingEnded extends PureComponent { } getEndingMessage() { - const { intl, code, endedReason } = this.props; + const { intl, code, ejectedReason, endedReason } = this.props; if (endedReason && endedReason === 'ENDED_DUE_TO_NO_MODERATOR') { return this.endWhenNoModeratorMinutes === 1 @@ -191,6 +191,10 @@ class MeetingEnded extends PureComponent { return intl.formatMessage(intlMessage.messageEndedByUser, { 0: this.meetingEndedBy }); } + if (intlMessage[ejectedReason]) { + return intl.formatMessage(intlMessage[ejectedReason]); + } + if (intlMessage[code]) { return intl.formatMessage(intlMessage[code]); } From 222a763b8c228d58c0b2207191f642a9068c6401 Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Wed, 17 Aug 2022 14:08:55 -0300 Subject: [PATCH 2/4] Prevent client to end meeting while trying to restablish authentication --- .../imports/ui/components/app/container.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx index d1d9050ffb..aa2d80489c 100755 --- a/bigbluebutton-html5/imports/ui/components/app/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx @@ -191,8 +191,14 @@ const currentUserEmoji = (currentUser) => (currentUser export default injectIntl(withModalMounter(withTracker(({ intl, baseControls }) => { Users.find({ userId: Auth.userID, meetingId: Auth.meetingID }).observe({ removed(userData) { - endMeeting(403, userData.ejectedReason || null); - }, + //wait 3secs (before endMeeting), client will try to authenticate again + setTimeout(() => { + const queryCurrentUser = Users.find({ userId: Auth.userID, meetingId: Auth.meetingID }); + if (queryCurrentUser.count() === 0) { + endMeeting(403, userData.ejectedReason || null); + } + }, 3000); + } }); const currentUser = Users.findOne( From 87e4c52cee67c5932b80902410db35bd7edd310c Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Mon, 22 Aug 2022 16:32:12 -0300 Subject: [PATCH 3/4] Fix error when trying to read role when user was removed already --- bigbluebutton-html5/imports/ui/components/app/container.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx index aa2d80489c..3a39b3f507 100755 --- a/bigbluebutton-html5/imports/ui/components/app/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx @@ -266,7 +266,7 @@ export default injectIntl(withModalMounter(withTracker(({ intl, baseControls }) randomlySelectedUser, currentUserId: currentUser?.userId, isPresenter, - isModerator: currentUser.role === ROLE_MODERATOR, + isModerator: currentUser?.role === ROLE_MODERATOR, meetingLayout: layout, meetingLayoutUpdatedAt: layoutUpdatedAt, presentationIsOpen, From 84e482e55e5d8415ee41fcf9de0fd4e1ba054b34 Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Mon, 29 Aug 2022 22:50:57 -0300 Subject: [PATCH 4/4] Remove delay to endMeeting when user is ejected=true --- .../imports/ui/components/app/container.jsx | 7 ++++--- .../ui/components/error-screen/component.jsx | 13 ++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx index 3a39b3f507..2b78c14037 100755 --- a/bigbluebutton-html5/imports/ui/components/app/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx @@ -191,14 +191,15 @@ const currentUserEmoji = (currentUser) => (currentUser export default injectIntl(withModalMounter(withTracker(({ intl, baseControls }) => { Users.find({ userId: Auth.userID, meetingId: Auth.meetingID }).observe({ removed(userData) { - //wait 3secs (before endMeeting), client will try to authenticate again + // wait 3secs (before endMeeting), client will try to authenticate again + const delayForReconnection = userData.ejected ? 0 : 3000; setTimeout(() => { const queryCurrentUser = Users.find({ userId: Auth.userID, meetingId: Auth.meetingID }); if (queryCurrentUser.count() === 0) { endMeeting(403, userData.ejectedReason || null); } - }, 3000); - } + }, delayForReconnection); + }, }); const currentUser = Users.findOne( diff --git a/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx b/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx index 24f24ca5c7..4013fcbf58 100644 --- a/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/error-screen/component.jsx @@ -46,6 +46,15 @@ const intlMessages = defineMessages({ user_inactivity_eject_reason: { id: 'app.meeting.logout.userInactivityEjectReason', }, + user_requested_eject_reason: { + id: 'app.meeting.logout.ejectedFromMeeting', + }, + duplicate_user_in_meeting_eject_reason: { + id: 'app.meeting.logout.duplicateUserEjectReason', + }, + not_enough_permission_eject_reason: { + id: 'app.meeting.logout.permissionEjectReason', + }, }); const propTypes = { @@ -93,7 +102,9 @@ class ErrorScreen extends PureComponent { {formatedMessage} { - !errorMessageDescription || ( + !errorMessageDescription + || formatedMessage === errorMessageDescription + || ( {errorMessageDescription}