set clientType from Flash clients

This commit is contained in:
Anton Georgiev 2018-06-26 14:13:14 +00:00
parent a6c693c93d
commit 67c7b90581
5 changed files with 72 additions and 0 deletions

View File

@ -168,6 +168,10 @@ package org.bigbluebutton.main.model.users
}
}
public function setUserClientType():void {
sender.setUserClientType();
}
public function logoutUser():void {
disconnect(true);
}

View File

@ -0,0 +1,35 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.main.model.users.events
{
import flash.events.Event;
public class SetUserClientTypeEvent extends Event
{
public static const SET_USER_CLIENT_TYPE:String = "SET_USER_CLIENT_TYPE";
public var clientType:String;
public var userID:String
public function SetUserClientTypeEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
}
}
}

View File

@ -42,6 +42,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
import org.bigbluebutton.main.model.users.events.ChangeRoleEvent;
import org.bigbluebutton.main.model.users.events.EmojiStatusEvent;
import org.bigbluebutton.main.model.users.events.SetUserClientTypeEvent;
import org.bigbluebutton.main.model.users.events.KickUserEvent;
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
<!--TODO: Move guest events to user events? -->
@ -218,6 +219,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<EventHandlers type="{BBBEvent.LOGOUT_END_MEETING_EVENT}" >
<MethodInvoker generator="{UserService}" method="logoutEndMeeting" />
</EventHandlers>
<EventHandlers type="{SetUserClientTypeEvent.SET_USER_CLIENT_TYPE}" >
<MethodInvoker generator="{UserService}" method="setUserClientType" />
</EventHandlers>
<EventHandlers type="{ChangeMyRole.CHANGE_MY_ROLE_EVENT}" >
<MethodInvoker generator="{GuestManager}" method="refreshGuestView" />

View File

@ -54,6 +54,7 @@ package org.bigbluebutton.modules.users.services
import org.bigbluebutton.main.model.users.BreakoutRoom;
import org.bigbluebutton.main.model.users.IMessageListener;
import org.bigbluebutton.main.model.users.events.ChangeMyRole;
import org.bigbluebutton.main.model.users.events.SetUserClientTypeEvent;
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
import org.bigbluebutton.main.model.users.events.StreamStoppedEvent;
import org.bigbluebutton.modules.phone.events.AudioSelectionWindowEvent;
@ -404,6 +405,11 @@ package org.bigbluebutton.modules.users.services
LiveMeeting.inst().me.locked = locked;
UsersUtil.applyLockSettings();
}
var setUserClientTypeEvent:SetUserClientTypeEvent = new SetUserClientTypeEvent(SetUserClientTypeEvent.SET_USER_CLIENT_TYPE);
setUserClientTypeEvent.userID = intId;
setUserClientTypeEvent.clientType = "FLASH";
dispatcher.dispatchEvent(setUserClientTypeEvent);
}
private function handleGetVoiceUsersMeetingRespMsg(msg:Object):void {

View File

@ -230,6 +230,27 @@ package org.bigbluebutton.modules.users.services
LOGGER.info(JSON.stringify(logData));
}, JSON.stringify(message));
}
public function setUserClientType():void {
var message:Object = {
header: {name: "SetUserClientTypeCmdMsg", meetingId: UsersUtil.getInternalMeetingID(),
userId: UsersUtil.getMyUserID()},
body: {userId: UsersUtil.getMyUserID(), clientType: "FLASH"}
};
var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage2x(
function(result:String):void { // On successful result
},
function(status:String):void { // status - On error occurred
var logData:Object = UsersUtil.initLogData();
logData.tags = ["apps"];
logData.logCode = "error_sending_set_user_client_type";
LOGGER.info(JSON.stringify(logData));
},
JSON.stringify(message)
);
}
public function logoutEndMeeting(userID:String):void {
var message:Object = {