Fixing minor bugs in locked features while changing role

This commit is contained in:
Mateus Dalepiane 2014-09-29 13:29:53 -03:00
parent f5703f64bb
commit 966e2da55f
6 changed files with 63 additions and 41 deletions

View File

@ -95,12 +95,11 @@ package org.bigbluebutton.main.model.users
} }
public function set role(r:String):void { public function set role(r:String):void {
_role = r; _role = r;
moderator = _role == MODERATOR;
verifyUserStatus(); verifyUserStatus();
} }
public function get moderator():Boolean { [Bindable] public var moderator:Boolean = false;
return _role == MODERATOR;
}
[Bindable] public var room:String = ""; [Bindable] public var room:String = "";
[Bindable] public var authToken:String = ""; [Bindable] public var authToken:String = "";

View File

@ -115,7 +115,7 @@ $Id: $
var conference:Conference = userManager.getConference(); var conference:Conference = userManager.getConference();
var me:BBBUser = conference.getMyUser(); var me:BBBUser = conference.getMyUser();
// trace(LOG + "allowMuteUnmute [ voiceJoined=[" + conference.voiceJoined + "], disableMic=[" + me.disableMyMic + "]"); // trace(LOG + "allowMuteUnmute [ voiceJoined=[" + conference.voiceJoined + "], disableMic=[" + me.disableMyMic + "]");
return (conference.voiceJoined && !me.disableMyMic); return (conference.voiceJoined && (!me.disableMyMic || me.moderator));
} }
private function updateMuteMeBtn(placeholder:Boolean = false):void { private function updateMuteMeBtn(placeholder:Boolean = false):void {

View File

@ -26,6 +26,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
creationComplete="init()"> creationComplete="init()">
<mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" /> <mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" />
<mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="refreshRole" />
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
@ -42,6 +43,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.core.managers.UserManager; import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.model.users.BBBUser; import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.Conference; import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
import org.bigbluebutton.modules.chat.events.ChatOptionsEvent; import org.bigbluebutton.modules.chat.events.ChatOptionsEvent;
import org.bigbluebutton.modules.chat.model.ChatOptions; import org.bigbluebutton.modules.chat.model.ChatOptions;
import org.bigbluebutton.util.i18n.ResourceUtil; import org.bigbluebutton.util.i18n.ResourceUtil;
@ -94,16 +96,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} }
private function lockSettingsChanged(e:Event):void { private function lockSettingsChanged(e:Event):void {
refreshListStatus();
}
if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) return; // Settings only affect viewers. private function refreshRole(e:ChangeMyRole):void {
refreshListStatus();
}
private function refreshListStatus():void {
var userManager:UserManager = UserManager.getInstance(); var userManager:UserManager = UserManager.getInstance();
var conference:Conference = userManager.getConference(); var conference:Conference = userManager.getConference();
var me:BBBUser = conference.getMyUser(); var me:BBBUser = conference.getMyUser();
usersList.enabled = !me.disableMyPrivateChat; usersList.enabled = !me.disableMyPrivateChat || me.moderator;
} }
]]> ]]>
</mx:Script> </mx:Script>

View File

@ -63,6 +63,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{ShortcutEvent.CHAT_DEBUG}" method="chatDebugInfo" /> <mate:Listener type="{ShortcutEvent.CHAT_DEBUG}" method="chatDebugInfo" />
<mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" /> <mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" />
<mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="refreshRole" />
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
@ -81,6 +82,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.UserLeftEvent; import org.bigbluebutton.main.events.UserLeftEvent;
import org.bigbluebutton.main.model.users.BBBUser; import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.Conference; import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
import org.bigbluebutton.modules.chat.ChatConstants; import org.bigbluebutton.modules.chat.ChatConstants;
import org.bigbluebutton.modules.chat.ChatUtil; import org.bigbluebutton.modules.chat.ChatUtil;
import org.bigbluebutton.modules.chat.events.ChatOptionsEvent; import org.bigbluebutton.modules.chat.events.ChatOptionsEvent;
@ -625,19 +627,24 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
} }
private function applyLockSettings():void { private function applyLockSettings():void {
updateChat();
}
if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) return; // Settings only affect viewers. private function updateChat():void {
var userManager:UserManager = UserManager.getInstance(); var userManager:UserManager = UserManager.getInstance();
var conference:Conference = userManager.getConference(); var conference:Conference = userManager.getConference();
var me:BBBUser = conference.getMyUser(); var me:BBBUser = conference.getMyUser();
if (publicChat) { if (publicChat) {
txtMsgArea.enabled = sendBtn.enabled = !me.disableMyPublicChat; txtMsgArea.enabled = sendBtn.enabled = !me.disableMyPublicChat || me.moderator;
} else { } else {
txtMsgArea.enabled = sendBtn.enabled = !me.disableMyPrivateChat; txtMsgArea.enabled = sendBtn.enabled = !me.disableMyPrivateChat || me.moderator;
} }
} }
private function refreshRole(e:ChangeMyRole):void {
updateChat();
}
]]> ]]>
</mx:Script> </mx:Script>

View File

@ -114,8 +114,7 @@ package org.bigbluebutton.modules.videoconf.maps
} }
private function displayToolbarButton():void { private function displayToolbarButton():void {
button.isPresenter = true; button.isPresenter = UsersUtil.amIPresenter();
if (options.presenterShareOnly) { if (options.presenterShareOnly) {
if (UsersUtil.amIPresenter()) { if (UsersUtil.amIPresenter()) {
button.isPresenter = true; button.isPresenter = true;

View File

@ -34,6 +34,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mate:Listener type="{BBBEvent.CAM_SETTINGS_CLOSED}" method="handleCamSettingsClosedEvent"/> <mate:Listener type="{BBBEvent.CAM_SETTINGS_CLOSED}" method="handleCamSettingsClosedEvent"/>
<mate:Listener type="{ShareCameraRequestEvent.SHARE_CAMERA_REQUEST}" receive="enabled=false" /> <mate:Listener type="{ShareCameraRequestEvent.SHARE_CAMERA_REQUEST}" receive="enabled=false" />
<mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" /> <mate:Listener type="{LockControlEvent.CHANGED_LOCK_SETTINGS}" method="lockSettingsChanged" />
<mate:Listener type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" method="refreshRole" />
<mx:Script> <mx:Script>
<![CDATA[ <![CDATA[
@ -46,6 +47,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.ShortcutEvent; import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.users.BBBUser; import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.Conference; import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
import org.bigbluebutton.main.views.MainToolbar; import org.bigbluebutton.main.views.MainToolbar;
import org.bigbluebutton.modules.videoconf.events.ClosePublishWindowEvent; import org.bigbluebutton.modules.videoconf.events.ClosePublishWindowEvent;
import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent; import org.bigbluebutton.modules.videoconf.events.ShareCameraRequestEvent;
@ -64,6 +66,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private var dispatcher:Dispatcher; private var dispatcher:Dispatcher;
public function lockSettingsChanged(e:*):void{ public function lockSettingsChanged(e:*):void{
updateButton();
}
private function refreshRole(e:ChangeMyRole):void {
updateButton();
}
private function updateButton():void {
var userManager:UserManager = UserManager.getInstance(); var userManager:UserManager = UserManager.getInstance();
var conference:Conference = userManager.getConference(); var conference:Conference = userManager.getConference();
var me:BBBUser = conference.getMyUser(); var me:BBBUser = conference.getMyUser();
@ -84,6 +94,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function set isPresenter(presenter:Boolean):void { public function set isPresenter(presenter:Boolean):void {
visible = presenter; visible = presenter;
this.includeInLayout = presenter;
} }
public function remoteClick(e:ShortcutEvent):void{ public function remoteClick(e:ShortcutEvent):void{