From 165545ee77d32067b03ddc85e053eb7d78f7c85d Mon Sep 17 00:00:00 2001 From: Ramon Souza Date: Wed, 19 May 2021 08:57:32 -0300 Subject: [PATCH 1/5] remove useless conditional in base component --- bigbluebutton-html5/imports/startup/client/base.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/startup/client/base.jsx b/bigbluebutton-html5/imports/startup/client/base.jsx index 90309f9498..636d680f90 100755 --- a/bigbluebutton-html5/imports/startup/client/base.jsx +++ b/bigbluebutton-html5/imports/startup/client/base.jsx @@ -176,7 +176,7 @@ class Base extends Component { // In case the meeting delayed to load if (!subscriptionsReady || !meetingExist) return; - if (approved && loading && subscriptionsReady) this.updateLoadingState(false); + if (approved && loading) this.updateLoadingState(false); if (prevProps.ejected || ejected) { Session.set('codeError', '403'); From e193fb7ec919d5dd35450082a092a91623b2a547 Mon Sep 17 00:00:00 2001 From: Ramon Souza Date: Wed, 19 May 2021 09:03:04 -0300 Subject: [PATCH 2/5] remove useless conditional in chat item component --- .../time-window-chat-item/message-chat-item/component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/chat/time-window-list/time-window-chat-item/message-chat-item/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/time-window-list/time-window-chat-item/message-chat-item/component.jsx index bfc29d2888..ca168c60aa 100644 --- a/bigbluebutton-html5/imports/ui/components/chat/time-window-list/time-window-chat-item/message-chat-item/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/time-window-list/time-window-chat-item/message-chat-item/component.jsx @@ -104,7 +104,7 @@ class MessageChatItem extends PureComponent { return; } - if (isElementInViewport(node) && !read) { + if (isElementInViewport(node)) { handleReadMessage(time); this.removeScrollListeners(); } From 7c2a1384e20ae4893899f6eae535f5dc2468c1ed Mon Sep 17 00:00:00 2001 From: Ramon Souza Date: Wed, 19 May 2021 09:07:14 -0300 Subject: [PATCH 3/5] remove useless conditional in whiteboard toolbar --- .../ui/components/whiteboard/whiteboard-toolbar/component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-toolbar/component.jsx b/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-toolbar/component.jsx index ed65d82bd9..1c0b65ba2b 100755 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-toolbar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-toolbar/component.jsx @@ -521,7 +521,7 @@ class WhiteboardToolbar extends Component { customIcon={false} label="Annotations" onItemClick={this.handleAnnotationChange} - objectsToRender={panMode ? annotations[annotations.length - 1] : annotations} + objectsToRender={annotations} objectSelected={annotationSelected} handleMouseEnter={this.handleMouseEnter} handleMouseLeave={this.handleMouseLeave} From 9592ca44fe6d927709c429a43043e3d26d849e5c Mon Sep 17 00:00:00 2001 From: Ramon Souza Date: Wed, 19 May 2021 09:20:28 -0300 Subject: [PATCH 4/5] remove useless conditionals in validateAutoToken handler --- .../server/handlers/validateAuthToken.js | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js b/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js index 8df1f24784..64ffe9a605 100644 --- a/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js +++ b/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js @@ -65,33 +65,31 @@ export default function handleValidateAuthToken({ body }, meetingId) { return; } - if (valid) { - // Define user ID on connections - pendingAuths.forEach( - (pendingAuth) => { - const { methodInvocationObject } = pendingAuth; + // Define user ID on connections + pendingAuths.forEach( + (pendingAuth) => { + const { methodInvocationObject } = pendingAuth; - /* Logic migrated from validateAuthToken method ( postponed to only run in case of success response ) - Begin */ - const sessionId = `${meetingId}--${userId}`; + /* Logic migrated from validateAuthToken method ( postponed to only run in case of success response ) - Begin */ + const sessionId = `${meetingId}--${userId}`; - methodInvocationObject.setUserId(sessionId); + methodInvocationObject.setUserId(sessionId); - const User = Users.findOne({ - meetingId, - userId, - }); + const User = Users.findOne({ + meetingId, + userId, + }); - if (!User) { - createDummyUser(meetingId, userId, authToken); - } + if (!User) { + createDummyUser(meetingId, userId, authToken); + } - ClientConnections.add(sessionId, methodInvocationObject.connection); - upsertValidationState(meetingId, userId, ValidationStates.VALIDATED, methodInvocationObject.connection.id); + ClientConnections.add(sessionId, methodInvocationObject.connection); + upsertValidationState(meetingId, userId, ValidationStates.VALIDATED, methodInvocationObject.connection.id); - /* End of logic migrated from validateAuthToken */ - }, - ); - } + /* End of logic migrated from validateAuthToken */ + }, + ); const selector = { meetingId, @@ -105,7 +103,7 @@ export default function handleValidateAuthToken({ body }, meetingId) { if (!User) return; // Publish user join message - if (valid && !waitForApproval) { + if (!waitForApproval) { Logger.info('User=', User); userJoin(meetingId, userId, User.authToken); } @@ -124,11 +122,9 @@ export default function handleValidateAuthToken({ body }, meetingId) { const numberAffected = Users.update(selector, modifier); if (numberAffected) { - if (valid) { - const sessionUserId = `${meetingId}-${userId}`; - const currentConnectionId = User.connectionId ? User.connectionId : false; - clearOtherSessions(sessionUserId, currentConnectionId); - } + const sessionUserId = `${meetingId}-${userId}`; + const currentConnectionId = User.connectionId ? User.connectionId : false; + clearOtherSessions(sessionUserId, currentConnectionId); Logger.info(`Validated auth token as ${valid} user=${userId} meeting=${meetingId}`); } else { From d11e0917b045e09f7f0f15f28c61b5b62158792c Mon Sep 17 00:00:00 2001 From: Ramon Souza Date: Wed, 19 May 2021 09:28:16 -0300 Subject: [PATCH 5/5] remove useless conditional in user-name component --- .../user-participants/user-list-item/user-name/component.jsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-name/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-name/component.jsx index e05ef2de3c..6d930ec44a 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-name/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-participants/user-list-item/user-name/component.jsx @@ -73,10 +73,6 @@ const UserName = (props) => { const userNameSub = []; - if (compact) { - return null; - } - if (isThisMeetingLocked && user.locked && user.role !== ROLE_MODERATOR) { userNameSub.push(