forked from bigbluebutton/bigbluebutton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add/remove user from presenter groups
- Loading branch information
1 parent
04cef71
commit 0305673
Showing
19 changed files
with
397 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.../src/main/scala/org/bigbluebutton/core/apps/users/AddUserToPresenterGroupCmdMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.bigbluebutton.core.apps.users | ||
|
||
import org.bigbluebutton.common2.msgs._ | ||
import org.bigbluebutton.core.models.{ Roles, Users2x } | ||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } | ||
|
||
trait AddUserToPresenterGroupCmdMsgHdlr { | ||
this: UsersApp => | ||
|
||
val liveMeeting: LiveMeeting | ||
val outGW: OutMsgRouter | ||
|
||
def handleAddUserToPresenterGroupCmdMsg(msg: AddUserToPresenterGroupCmdMsg) { | ||
|
||
def broadcastAddUserToPresenterGroup(meetingId: String, userId: String, requesterId: String): Unit = { | ||
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId) | ||
val envelope = BbbCoreEnvelope(UserAddedToPresenterGroupEvtMsg.NAME, routing) | ||
val header = BbbClientMsgHeader(UserAddedToPresenterGroupEvtMsg.NAME, meetingId, userId) | ||
val body = UserAddedToPresenterGroupEvtMsgBody(userId, requesterId) | ||
val event = UserAddedToPresenterGroupEvtMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
|
||
outGW.send(msgEvent) | ||
} | ||
|
||
val userId = msg.body.userId | ||
val requesterId = msg.body.requesterId | ||
|
||
for { | ||
requester <- Users2x.findWithIntId(liveMeeting.users2x, requesterId) | ||
} yield { | ||
if (requester.role == Roles.MODERATOR_ROLE) { | ||
Users2x.addUserToPresenterGroup(liveMeeting.users2x, userId) | ||
broadcastAddUserToPresenterGroup(liveMeeting.props.meetingProp.intId, userId, requesterId) | ||
} | ||
} | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...main/scala/org/bigbluebutton/core/apps/users/RemoveUserFromPresenterGroupCmdMsgHdlr.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.bigbluebutton.core.apps.users | ||
|
||
import org.bigbluebutton.common2.msgs._ | ||
import org.bigbluebutton.core.models.{ Roles, Users2x } | ||
import org.bigbluebutton.core.running.{ LiveMeeting, OutMsgRouter } | ||
|
||
trait RemoveUserFromPresenterGroupCmdMsgHdlr { | ||
this: UsersApp => | ||
|
||
val liveMeeting: LiveMeeting | ||
val outGW: OutMsgRouter | ||
|
||
def handleRemoveUserFromPresenterGroupCmdMsg(msg: RemoveUserFromPresenterGroupCmdMsg) { | ||
|
||
def broadcastRemoveUserFromPresenterGroup(meetingId: String, userId: String, requesterId: String): Unit = { | ||
val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, meetingId, userId) | ||
val envelope = BbbCoreEnvelope(UserRemovedFromPresenterGroupEvtMsg.NAME, routing) | ||
val header = BbbClientMsgHeader(UserRemovedFromPresenterGroupEvtMsg.NAME, meetingId, userId) | ||
val body = UserRemovedFromPresenterGroupEvtMsgBody(userId, requesterId) | ||
val event = UserRemovedFromPresenterGroupEvtMsg(header, body) | ||
val msgEvent = BbbCommonEnvCoreMsg(envelope, event) | ||
|
||
outGW.send(msgEvent) | ||
} | ||
|
||
val userId = msg.body.userId | ||
val requesterId = msg.body.requesterId | ||
|
||
for { | ||
requester <- Users2x.findWithIntId(liveMeeting.users2x, requesterId) | ||
} yield { | ||
if (requester.role == Roles.MODERATOR_ROLE) { | ||
Users2x.removeUserFromPresenterGroup(liveMeeting.users2x, userId) | ||
broadcastRemoveUserFromPresenterGroup(liveMeeting.props.meetingProp.intId, userId, requesterId) | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...tton-client/src/org/bigbluebutton/main/model/users/events/AddUserToPresenterGroupEvent.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ | ||
* | ||
* Copyright (c) 2017 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 AddUserToPresenterGroupEvent extends Event | ||
{ | ||
public static const ADD_USER_TO_PRESENTER_GROUP:String = "ADD_USER_TO_PRESENTER_GROUP"; | ||
|
||
public var userId:String; | ||
|
||
public function AddUserToPresenterGroupEvent(userId:String) | ||
{ | ||
this.userId = userId; | ||
super(ADD_USER_TO_PRESENTER_GROUP, true, false); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...client/src/org/bigbluebutton/main/model/users/events/RemoveUserFromPresenterGroupEvent.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ | ||
* | ||
* Copyright (c) 2017 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 RemoveUserFromPresenterGroupEvent extends Event | ||
{ | ||
public static const REMOVE_USER_FROM_PRESENTER_GROUP:String = "REMOVE_USER_FROM_PRESENTER_GROUP"; | ||
|
||
public var userId:String; | ||
|
||
public function RemoveUserFromPresenterGroupEvent(userId:String) | ||
{ | ||
this.userId = userId; | ||
super(REMOVE_USER_FROM_PRESENTER_GROUP, true, false); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...on-client/src/org/bigbluebutton/main/model/users/events/UserAddedToPresenterGroupEvent.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ | ||
* | ||
* Copyright (c) 2017 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 UserAddedToPresenterGroupEvent extends Event | ||
{ | ||
public static const USER_ADDED_TO_PRESENTER_GROUP:String = "USER_ADDED_TO_PRESENTER_GROUP"; | ||
|
||
public var userId:String; | ||
|
||
public function UserAddedToPresenterGroupEvent(userId:String) | ||
{ | ||
this.userId = userId; | ||
super(USER_ADDED_TO_PRESENTER_GROUP, true, false); | ||
} | ||
} | ||
} |
Oops, something went wrong.