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 b298c9ede90c7dd5741616921f4dc8bd5249f089..a61867359a371e57a6b627f2566419985c45dad0 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/AddChatTabBox.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/AddChatTabBox.mxml @@ -29,7 +29,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <fx:Declarations> <mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" /> - <mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="refreshRole" /> + <mate:Listener type="{UserStatusChangedEvent.USER_STATUS_CHANGED}" method="refreshRole" /> <mate:Listener type="{UserJoinedEvent.JOINED}" method="handleUserJoinedEvent" /> <mate:Listener type="{UserLeftEvent.LEFT}" method="handleUserLeftEvent" /> </fx:Declarations> @@ -49,10 +49,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.events.CoreEvent; import org.bigbluebutton.core.events.LockControlEvent; + import org.bigbluebutton.core.events.UserStatusChangedEvent; import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.main.events.UserJoinedEvent; import org.bigbluebutton.main.events.UserLeftEvent; - import org.bigbluebutton.main.model.users.events.ChangeMyRole; import org.bigbluebutton.modules.chat.events.ChatNoiseEnabledEvent; import org.bigbluebutton.modules.chat.events.ChatOptionsEvent; import org.bigbluebutton.modules.chat.events.ChatToolbarButtonEvent; @@ -164,16 +164,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. refreshListStatus(); } - private function refreshRole(e:ChangeMyRole):void { + private function refreshRole(e:Event):void { clearBtn.visible = clearBtn.enabled = clearBtn.includeInLayout = clrBtnVisible = UsersUtil.amIModerator(); refreshListStatus(); } private function refreshListStatus():void { + handler.disableModeratorsFilter(); + if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) return; // Settings only affect viewers. - - usersList.enabled = ! LiveMeeting.inst().me.disableMyPrivateChat; + + if (LiveMeeting.inst().me.disableMyPrivateChat) { + handler.enableModeratorsFilter(); + } } public function sendSaveEvent():void{ diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml index 858839a848394776c88a9acdacaf16c29c6b8574..0c5c43c6678f26946d085dc88b177563115e59ee 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatBox.mxml @@ -43,7 +43,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. <mate:Listener type="{ShortcutEvent.SEND_MESSAGE}" method="remoteSendMessage" /> <mate:Listener type="{BBBEvent.RECONNECT_DISCONNECTED_EVENT}" receive="refreshChat(event)"/> <mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" /> - <mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="refreshRole" /> + <mate:Listener type="{UserStatusChangedEvent.USER_STATUS_CHANGED}" method="refreshRole" /> </fx:Declarations> <fx:Script> @@ -59,15 +59,16 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. import org.as3commons.lang.StringUtils; import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.getClassLogger; + import org.bigbluebutton.common.Role; import org.bigbluebutton.core.Options; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.events.LockControlEvent; + import org.bigbluebutton.core.events.UserStatusChangedEvent; import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.events.ShortcutEvent; import org.bigbluebutton.main.events.UserJoinedEvent; import org.bigbluebutton.main.events.UserLeftEvent; - import org.bigbluebutton.main.model.users.events.ChangeMyRole; import org.bigbluebutton.modules.chat.ChatUtil; import org.bigbluebutton.modules.chat.events.ChatEvent; import org.bigbluebutton.modules.chat.events.ChatHistoryEvent; @@ -589,11 +590,11 @@ 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; + txtMsgArea.enabled = sendBtn.enabled = !LiveMeeting.inst().me.disableMyPrivateChat || LiveMeeting.inst().users.getUser(chatWithUserID).role == Role.MODERATOR; } } - private function refreshRole(e:ChangeMyRole):void { + private function refreshRole(e:Event):void { applyLockSettings(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindowEventHandler.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindowEventHandler.as index 5387844119d087c92dc5f9c0c9b9e79b8130270a..5495984657a9615f21d53be26689a61b94e5b19a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindowEventHandler.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindowEventHandler.as @@ -3,6 +3,7 @@ package org.bigbluebutton.modules.chat.views import mx.collections.ArrayCollection; import mx.collections.Sort; + import org.bigbluebutton.common.Role; import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.model.LiveMeeting; import org.bigbluebutton.core.model.users.User2x; @@ -72,6 +73,20 @@ package org.bigbluebutton.modules.chat.views public function handleUserLeftEvent(userId: String):void { removeUser(userId, users); } + + public function enableModeratorsFilter():void { + users.filterFunction = filterModeratorsOnly; + users.refresh(); + } + + public function disableModeratorsFilter():void { + users.filterFunction = null; + users.refresh(); + } + + private function filterModeratorsOnly(item:Object):Boolean { + return LiveMeeting.inst().users.getUser(item.userId).role == Role.MODERATOR; + } private function sortFunction(a:Object, b:Object, array:Array = null):int { /*