Repository navigation
Allow to disable new chat features through the param disabledFeatures - #21354
Conversation
…-reaction using the param disabledFeatures"
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Outside diff range and nitpick comments (11)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageReactionReqMsgHdlr.scala (2)
17-17: LGTM! Consider extracting the feature name to a constant.The introduction of
chatMessageReactionsDisabledaligns well with the PR objective. It correctly checks if the "chatMessageReactions" feature is disabled.For improved readability and maintainability, consider extracting "chatMessageReactions" to a constant:
+ private val CHAT_MESSAGE_REACTIONS_FEATURE = "chatMessageReactions" val chatMessageReactionsDisabled: Boolean = liveMeeting.props.meetingProp.disabledFeatures.contains(CHAT_MESSAGE_REACTIONS_FEATURE)This approach would make it easier to update the feature name if needed and reduce the risk of typos.
47-47: LGTM! Consider breaking down the condition for improved readability.The modification correctly incorporates the new check for disabled chat message reactions, aligning with the PR objective. The logic ensures that reactions are only processed when appropriate.
For improved readability, consider breaking down the complex condition into smaller, named parts:
- if (!chatDisabled && !chatMessageReactionsDisabled && !(applyPermissionCheck && chatLocked) && !chatLockedForUser) { + val featuresEnabled = !chatDisabled && !chatMessageReactionsDisabled + val permissionsAllowed = !(applyPermissionCheck && chatLocked) && !chatLockedForUser + if (featuresEnabled && permissionsAllowed) {This approach makes the condition easier to understand and maintain.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/DeleteGroupChatMessageReactionReqMsgHdlr.scala (2)
17-17: LGTM! Consider extracting the feature name to a constant.The addition of
chatMessageReactionsDisabledaligns well with the PR objectives and follows the existing pattern. Good job!For improved readability and maintainability, consider extracting the feature name "chatMessageReactions" to a constant. This would make it easier to update if the feature name changes in the future and improve consistency across the codebase. For example:
val ChatMessageReactionsFeature = "chatMessageReactions" val chatMessageReactionsDisabled: Boolean = liveMeeting.props.meetingProp.disabledFeatures.contains(ChatMessageReactionsFeature)
47-47: LGTM! Consider refactoring for improved readability.The addition of
!chatMessageReactionsDisabledto the conditional statement correctly implements the feature disabling functionality. This change aligns well with the PR objectives and maintains consistency with existing checks.To improve readability, consider refactoring the condition into smaller, named boolean expressions. This would make the code more self-documenting and easier to maintain. For example:
val featuresEnabled = !chatDisabled && !chatMessageReactionsDisabled val permissionsAllowed = !(applyPermissionCheck && chatLocked) && !chatLockedForUser if (featuresEnabled && permissionsAllowed) { // Existing code... }This refactoring would make the condition's intent clearer and easier to modify in the future if additional checks need to be added.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/DeleteGroupChatMessageReqMsgHdlr.scala (1)
48-48: Approve logic change, but consider refactoring for readability.The modification correctly incorporates the new check for the disabled delete feature, ensuring that the deletion process only proceeds when both
chatDisabledanddeleteChatMessageDisabledare false. This aligns well with the PR objectives.However, the line has become quite long. Consider refactoring for improved readability:
val deleteAllowed = !chatDisabled && !deleteChatMessageDisabled && !(applyPermissionCheck && chatLocked) && !chatLockedForUser if (deleteAllowed) { // Existing code block }This refactoring maintains the same logic while improving readability and making future modifications easier.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageMsgHdlr.scala (1)
Line range hint
1-110: Overall implementation looks good, with a minor suggestionThe changes successfully implement the
disabledFeaturesfunctionality for the reply feature, aligning well with the PR objectives. The code maintains good practices such as immutability and clear variable naming.As a minor suggestion for improvement:
Consider extracting the logic for clearing the
replyToMessageIdinto a separate method for better readability and potential reuse. For example:def clearReplyToMessageIdIfDisabled(msg: GroupChatMessage, isDisabled: Boolean): GroupChatMessage = { if (isDisabled && msg.replyToMessageId.nonEmpty) { msg.copy(replyToMessageId = "") } else { msg } } // Usage val groupChatMsgReceived = clearReplyToMessageIdIfDisabled(msg.body.msg, replyChatMessageDisabled)This refactoring would enhance code organization and make the main logic flow easier to follow.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/GroupChat.scala (1)
Line range hint
1-126: File review conclusion: Minor improvement, but incomplete feature implementationThe changes in this file represent a small improvement in code simplicity and consistency. However, they don't fully address the PR objectives of introducing a
disabledFeaturesparameter to disable specific chat features.Consider the following points:
The implementation of the
disabledFeaturesparameter is not visible in this file. Are there other files in this PR that implement this functionality?If this is the only change in the PR, it might be beneficial to split this into a separate, smaller PR for code cleanup, and create a new PR for the feature disabling functionality.
Update the PR description to accurately reflect the changes made in this commit if the scope has changed.
bigbluebutton-web/grails-app/conf/bigbluebutton.properties (1)
Line range hint
468-474: Approval of legacy property updates with a suggestionThe updates to the comments for
learningDashboardEnabled,breakoutRoomsEnabled, andallowDuplicateExtUseridare appropriate and provide clear guidance on the deprecation of these properties. This aligns well with the overall objective of introducing thedisabledFeaturesparameter.Consider adding a comment above the
disabledFeaturesproperty to explicitly state that it's the new recommended way to disable specific features, including those previously controlled by the legacy properties. This would further emphasize the transition to the new system.docs/docs/data/create.tsx (3)
378-378: Clarify roles in 'deleteChatMessage' descriptionConsider clarifying "moderators or owner" to "moderators or the owner" for better readability.
Apply this diff to improve clarity:
- <b>Delete Chat Message (moderators or owner)</b> + <b>Delete Chat Message (moderators or the owner)</b>
382-382: Clarify ownership in 'editChatMessage' descriptionConsider changing "only owner" to "only the owner" to enhance clarity.
Apply this diff to improve clarity:
- <b>Edit Chat Message (only owner)</b> + <b>Edit Chat Message (only the owner)</b>
392-392: Ensure consistent capitalization in 'chatMessageReactions' descriptionCapitalize "Chat Message" consistently.
Apply this diff to improve consistency:
- <b>Send Reactions to a chat message</b> + <b>Send Reactions to a Chat Message</b>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (8)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/DeleteGroupChatMessageReactionReqMsgHdlr.scala (2 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/DeleteGroupChatMessageReqMsgHdlr.scala (2 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/EditGroupChatMessageReqMsgHdlr.scala (2 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/GroupChat.scala (1 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageMsgHdlr.scala (3 hunks)
- akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageReactionReqMsgHdlr.scala (2 hunks)
- bigbluebutton-web/grails-app/conf/bigbluebutton.properties (1 hunks)
- docs/docs/data/create.tsx (1 hunks)
🔇 Additional comments (11)
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageReactionReqMsgHdlr.scala (1)
Line range hint
1-65: Overall, the changes look good and achieve the PR objectives.The implementation successfully introduces the ability to disable chat message reactions, aligning with the PR's goal. The changes are focused, maintain consistency with existing code patterns, and do not introduce unnecessary complexity.
Key points:
- The new
chatMessageReactionsDisabledvariable correctly checks for the disabled feature.- The conditional statement has been appropriately modified to incorporate the new check.
The suggested minor improvements (extracting the feature name to a constant and breaking down the complex condition) would further enhance code readability and maintainability.
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/DeleteGroupChatMessageReactionReqMsgHdlr.scala (1)
Line range hint
1-65: Overall implementation looks good.The changes in this file successfully implement the ability to disable the chat message reactions feature, aligning well with the PR objectives. The implementation is consistent with existing patterns and maintains the overall structure and logic of the code.
A few minor suggestions for improvement have been made, but these are not critical for the functionality. Great job on implementing this feature!
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/DeleteGroupChatMessageReqMsgHdlr.scala (2)
16-16: LGTM: New variable for disabling delete chat message feature.The addition of
deleteChatMessageDisabledaligns well with the PR objectives. It correctly checks thedisabledFeaturesproperty and follows the existing naming convention.
Line range hint
1-78: Implementation successfully adds delete chat message disabling feature.The changes effectively implement the ability to disable the delete chat message feature, aligning well with the PR objectives. The implementation is consistent with existing code patterns and introduces no apparent security issues or logical errors.
To ensure consistent implementation across the codebase, let's verify the usage of the
disabledFeaturesproperty:This verification will help ensure that the
disabledFeaturesproperty is used consistently across the codebase and that similar implementations are applied to other relevant message handlers.✅ Verification successful
✅ Verification Successful: Delete Group Chat Message Disable Feature Confirmed
The implementation effectively adds the delete chat message disabling feature and aligns consistently with the existing usage of the
disabledFeaturesproperty across the codebase. No issues were identified during the verification process.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `disabledFeatures` property across the codebase # Test 1: Check for other usages of `disabledFeatures` echo "Checking for other usages of disabledFeatures:" rg --type scala "disabledFeatures" -g '!DeleteGroupChatMessageReqMsgHdlr.scala' # Test 2: Check for similar implementations in other message handlers echo "Checking for similar implementations in other message handlers:" rg --type scala "val \w+Disabled: Boolean = liveMeeting\.props\.meetingProp\.disabledFeatures\.contains\(" -g '*MsgHdlr.scala'Length of output: 11537
akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageMsgHdlr.scala (4)
3-3: LGTM: Import statement cleanupThe modification to the import statement removes redundancy and improves code clarity by importing only the necessary method.
28-28: LGTM: New variable to check for disabled reply featureThe addition of
replyChatMessageDisabledaligns with the PR objective of allowing specific chat features to be disabled. The variable name is clear, and the implementation correctly uses thedisabledFeaturesproperty of the meeting.
77-83: LGTM: Implemented logic to disable reply featureThe introduction of
groupChatMsgReceivedwith conditional logic to clearreplyToMessageIdwhen the reply feature is disabled is well-implemented. It aligns with the PR objective and maintains immutability by using thecopymethod.
85-85: LGTM: Updated gcMessage constructionThe modification to use
groupChatMsgReceivedinstead ofmsg.body.msgin thegcMessageconstruction ensures that the potentially modified message (with clearedreplyToMessageId) is correctly propagated. This change is consistent with the new feature disabling functionality.akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/GroupChat.scala (1)
23-26: Approved: Method simplification, but needs clarificationThe changes to
toGroupChatMessagemethod simplify its signature and ensure consistent use of metadata from the original message. This is a good improvement for maintainability.However, I have a few points to address:
Could you clarify how this change relates to the PR objective of introducing a
disabledFeaturesparameter? It's not immediately clear from this modification alone.Consider adding a comment to explain the reasoning behind this change, especially if it's a prerequisite for the feature disabling functionality.
To ensure this change doesn't break existing functionality, please run the following verification script:
bigbluebutton-web/grails-app/conf/bigbluebutton.properties (2)
456-457: Update todisabledFeaturesproperty aligns with PR objectivesThe changes to the
disabledFeaturesproperty now include the new chat features mentioned in the PR objectives:
deleteChatMessageeditChatMessagereplyChatMessagechatMessageReactionsThis update correctly implements the ability to disable these new chat functionalities as described in the PR summary.
Line range hint
456-474: Summary: Successful implementation ofdisabledFeatureswith clear migration pathThe changes in this file successfully achieve the PR's objective of introducing the
disabledFeaturesparameter to allow disabling of specific new chat functionalities. The implementation is clean and well-documented, with the following key points:
- The
disabledFeaturesproperty now includes options for the new chat features.- Legacy properties are clearly marked as deprecated, with guidance on using the new
disabledFeaturesproperty instead.- The
allowDuplicateExtUseridproperty is correctly marked as legacy, with a reference to the newmaxUserConcurrentAccessesproperty.These changes provide a clear migration path for users transitioning from the old configuration to the new one, while maintaining backward compatibility. The implementation is robust and aligns perfectly with the PR objectives.
| <li> | ||
| <code className="language-plaintext highlighter-rouge"> | ||
| replyChatMessage | ||
| </code> - <b>Reply a Chat Message</b> |
There was a problem hiding this comment.
Fix grammatical error in 'replyChatMessage' description
Change "Reply a Chat Message" to "Reply to a Chat Message" for correct grammar.
Apply this diff to fix the grammatical error:
- <b>Reply a Chat Message</b>
+ <b>Reply to a Chat Message</b>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| </code> - <b>Reply a Chat Message</b> | |
| </code> - <b>Reply to a Chat Message</b> |
| # Available options: | ||
| # chat, sharedNotes, polls, screenshare, externalVideos, layouts, captions, liveTranscription, | ||
| # sharedNotes, polls, screenshare, externalVideos, layouts, captions, liveTranscription, | ||
| # chat, deleteChatMessage, editChatMessage, replyChatMessage, chatMessageReactions |
There was a problem hiding this comment.
Please sort alphabetically, possibly each item on new line 🙏
| <> | ||
| List (comma-separated) of features to disable in a particular meeting. (added 2.5) | ||
| <br /><br /> | ||
| Available options to disable: |
There was a problem hiding this comment.
Very much in favor of this suggestion. Thanks, Bunny!
| <li> | ||
| <code className="language-plaintext highlighter-rouge"> | ||
| breakoutRooms | ||
| </code> - <b>Breakout Rooms</b> |
There was a problem hiding this comment.
|
Actually, I think it will be best if we don't yet document in We should wait until we can support these in recording #21356 , playback, (ideally testing too) |
|
I reverted all documentations for now! |
|
@JoVictorNunes please make the frontend respect these new |
Automated tests Summary✅ All the CI tests have passed! |


Allow to disable the new chat features through the param
disabledFeatures.deleteChatMessageeditChatMessagereplyChatMessagechatMessageReactionsIt affects only the backend once the frontend portion is under development.