diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/CreateGroupChatReqMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/CreateGroupChatReqMsgHdlr.scala index 368383fb5c121b91db668cbb91b271b801b70337..fddebc0b0be64a68586d76bf1095cac897ce5f7d 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/CreateGroupChatReqMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/CreateGroupChatReqMsgHdlr.scala @@ -26,7 +26,14 @@ trait CreateGroupChatReqMsgHdlr extends SystemConfiguration { if (user.role != Roles.MODERATOR_ROLE) { if (msg.body.access == GroupChatAccess.PRIVATE) { val permissions = MeetingStatus2x.getPermissions(liveMeeting.status) - chatLocked = user.locked && permissions.disablePrivChat + val modMembers = msg.body.users.filter(userId => Users2x.findWithIntId(liveMeeting.users2x, userId) match { + case Some(user) => user.role == Roles.MODERATOR_ROLE + case None => false + }) + // don't lock creation of private chats that involve a moderator + if (modMembers.length == 0) { + chatLocked = user.locked && permissions.disablePrivChat + } } else { chatLocked = true } diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageMsgHdlr.scala index 09221ea54a3e82bab496dc030d24371a982258d2..b2b96a2c150f71e9a72dce42da90e717722bb791 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/groupchats/SendGroupChatMessageMsgHdlr.scala @@ -28,7 +28,14 @@ trait SendGroupChatMessageMsgHdlr { if (user.role != Roles.MODERATOR_ROLE && user.locked) { val permissions = MeetingStatus2x.getPermissions(liveMeeting.status) if (groupChat.access == GroupChatAccess.PRIVATE) { - chatLocked = permissions.disablePrivChat + val modMembers = groupChat.users.filter(cu => Users2x.findWithIntId(liveMeeting.users2x, cu.id) match { + case Some(user) => user.role == Roles.MODERATOR_ROLE + case None => false + }) + // don't lock private chats that involve a moderator + if (modMembers.length == 0) { + chatLocked = permissions.disablePrivChat + } } else { chatLocked = permissions.disablePubChat } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatOptionsTab.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatOptionsTab.mxml old mode 100644 new mode 100755 index bc78dfbaa514dd08ae6dbb3eabd871a8642df5d9..3e6e171838e66205cd595e68833490ddea8d54d2 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatOptionsTab.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatOptionsTab.mxml @@ -217,10 +217,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. } private function refreshListStatus():void { - - if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) return; // Settings only affect viewers. - - usersList.enabled = ! LiveMeeting.inst().me.disableMyPrivateChat; + if (LiveMeeting.inst().me.disableMyPrivateChat) { + handler.enableModeratorsFilter(); + } else { + handler.disableModeratorsFilter(); + } + users = removeMe(handler.users); } public function sendSaveEvent():void{ diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatTab.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatTab.mxml index 5c69d8d21684a287769ce8b8c68ddef0496ab838..60aeefe5de2dfe7c6d2a56ade5521c77e4390d09 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatTab.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatTab.mxml @@ -69,6 +69,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. import org.bigbluebutton.core.events.LockControlEvent; import org.bigbluebutton.core.events.UserStatusChangedEvent; import org.bigbluebutton.core.model.LiveMeeting; + import org.bigbluebutton.core.model.users.User2x; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.events.ShortcutEvent; import org.bigbluebutton.main.events.UserJoinedEvent; @@ -87,13 +88,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. import org.bigbluebutton.modules.chat.model.ChatOptions; import org.bigbluebutton.modules.chat.model.GroupChat; import org.bigbluebutton.modules.chat.vo.ChatMessageVO; + import org.bigbluebutton.modules.chat.vo.GroupChatUser; import org.bigbluebutton.modules.polling.events.StartCustomPollEvent; import org.bigbluebutton.util.i18n.ResourceUtil; private static const LOGGER:ILogger = getClassLogger(ChatTab); public var publicChat:Boolean = false; - public var chatWithUserID:String; public var chatWithUsername:String public var chatId: String = null; public var parentWindowId:String = null; @@ -609,7 +610,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. if (publicChat) { txtMsgArea.enabled = sendBtn.enabled = !LiveMeeting.inst().me.disableMyPublicChat; } else { - txtMsgArea.enabled = sendBtn.enabled = !LiveMeeting.inst().me.disableMyPrivateChat || LiveMeeting.inst().users.getUser(chatWithUserID).role == Role.MODERATOR; + var chattingWithMod:Boolean = false; + var gc:GroupChat = LiveMeeting.inst().chats.getGroupChat(chatId); + for (var i:int = 0; i < gc.users.length; i++) { + var chatUser:GroupChatUser = gc.users[i] as GroupChatUser; + if (chatUser.id != UsersUtil.getMyUserID()) { + var user:User2x = UsersUtil.getUser(chatUser.id); + if (user && user.role == Role.MODERATOR) { + chattingWithMod = true; + } + } + } + txtMsgArea.enabled = sendBtn.enabled = !LiveMeeting.inst().me.disableMyPrivateChat || chattingWithMod; } } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml index 0564867706b1b34a91bbc87cb1393369c8ca4b07..9febf4c8a4d24abcd3eda8cf53392f096521ae5a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml @@ -340,7 +340,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. var chatBox:ChatTab = new ChatTab(); chatBox.name = groupChatId; - chatBox.chatWithUserID = groupChatId; chatBox.parentWindowId = windowId; chatBox.tabIndexer.startIndex = tabIndexer.startIndex + 10; chatBox.chatMessages = new ChatConversation(groupChatId);