Merge pull request #3731 from antobinary/br-kick
[HTML5] Do not allow breakout room users to kick each other
This commit is contained in:
commit
aeebfa27d0
@ -91,6 +91,11 @@ function observeBreakoutEnd() {
|
||||
});
|
||||
}
|
||||
|
||||
function meetingIsBreakout() {
|
||||
const breakouts = Breakouts.find().fetch();
|
||||
return (breakouts && breakouts.some(b => b.breakoutMeetingId === Auth.meetingID));
|
||||
}
|
||||
|
||||
function wasUserKicked() {
|
||||
wasKickedDep.depend();
|
||||
return wasKicked;
|
||||
@ -137,4 +142,5 @@ export {
|
||||
clearModal,
|
||||
getCaptionsStatus,
|
||||
getFontSize,
|
||||
meetingIsBreakout,
|
||||
};
|
||||
|
@ -93,15 +93,12 @@ class NavBar extends Component {
|
||||
|
||||
renderPresentationTitle() {
|
||||
const {
|
||||
meetingId,
|
||||
currentUserId,
|
||||
breakouts,
|
||||
isBreakoutRoom,
|
||||
presentationTitle,
|
||||
} = this.props;
|
||||
|
||||
const presentationTitle = this.props.presentationTitle;
|
||||
const breakouts = this.props.breakouts;
|
||||
const isMeetingBreakout = breakouts.find(b => b.breakoutMeetingId === meetingId);
|
||||
|
||||
if (!breakouts.length || isMeetingBreakout) {
|
||||
if (isBreakoutRoom) {
|
||||
return (
|
||||
<h1 className={styles.presentationTitle}>{presentationTitle}</h1>
|
||||
);
|
||||
@ -129,9 +126,8 @@ class NavBar extends Component {
|
||||
componentDidUpdate() {
|
||||
const {
|
||||
breakouts,
|
||||
currentUserId,
|
||||
meetingId,
|
||||
getBreakoutJoinURL,
|
||||
isBreakoutRoom,
|
||||
} = this.props;
|
||||
|
||||
breakouts.forEach(breakout => {
|
||||
@ -141,8 +137,7 @@ class NavBar extends Component {
|
||||
|
||||
const breakoutURL = getBreakoutJoinURL(breakout);
|
||||
|
||||
const meetingIsBreakout = meetingId === breakout.breakoutMeetingId;
|
||||
if (!this.state.didSendBreakoutInvite && !meetingIsBreakout) {
|
||||
if (!this.state.didSendBreakoutInvite && !isBreakoutRoom) {
|
||||
this.inviteUserToBreakout(breakout, breakoutURL);
|
||||
}
|
||||
});
|
||||
|
@ -7,6 +7,7 @@ import Auth from '/imports/ui/services/auth';
|
||||
import userListService from '../user-list/service';
|
||||
import ChatService from '../chat/service';
|
||||
import Service from './service';
|
||||
import { meetingIsBreakout } from '/imports/ui/components/app/service';
|
||||
|
||||
import NavBar from './component';
|
||||
|
||||
@ -65,6 +66,7 @@ export default withRouter(createContainer(({ location, router }) => {
|
||||
getBreakoutJoinURL: Service.getBreakoutJoinURL,
|
||||
presentationTitle: meetingTitle,
|
||||
hasUnreadMessages: checkUnreadMessages(),
|
||||
isBreakoutRoom: meetingIsBreakout(),
|
||||
beingRecorded: meetingRecorded,
|
||||
toggleUserList: () => {
|
||||
if (location.pathname.indexOf('/users') !== -1) {
|
||||
|
@ -116,6 +116,7 @@ class UserList extends Component {
|
||||
currentUser,
|
||||
userActions,
|
||||
compact,
|
||||
isBreakoutRoom,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
@ -146,6 +147,7 @@ class UserList extends Component {
|
||||
<UserListItem
|
||||
compact={this.state.compact}
|
||||
key={user.id}
|
||||
isBreakoutRoom={isBreakoutRoom}
|
||||
user={user}
|
||||
currentUser={currentUser}
|
||||
userActions={userActions}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { createContainer } from 'meteor/react-meteor-data';
|
||||
import { meetingIsBreakout } from '/imports/ui/components/app/service';
|
||||
import Service from './service.js';
|
||||
|
||||
import UserList from './component.jsx';
|
||||
@ -13,6 +14,7 @@ class UserListContainer extends Component {
|
||||
openChats,
|
||||
openChat,
|
||||
userActions,
|
||||
isBreakoutRoom,
|
||||
children,
|
||||
} = this.props;
|
||||
|
||||
@ -23,6 +25,7 @@ class UserListContainer extends Component {
|
||||
currentUser={currentUser}
|
||||
openChats={openChats}
|
||||
openChat={openChat}
|
||||
isBreakoutRoom={isBreakoutRoom}
|
||||
userActions={userActions}>
|
||||
{children}
|
||||
</UserList>
|
||||
@ -36,4 +39,5 @@ export default createContainer(({ params }) => ({
|
||||
openChats: Service.getOpenChats(params.chatID),
|
||||
openChat: params.chatID,
|
||||
userActions: Service.userActions,
|
||||
isBreakoutRoom: meetingIsBreakout(),
|
||||
}), UserListContainer);
|
||||
|
@ -102,6 +102,7 @@ class UserListItem extends Component {
|
||||
user,
|
||||
userActions,
|
||||
router,
|
||||
isBreakoutRoom,
|
||||
} = this.props;
|
||||
|
||||
const {
|
||||
@ -120,7 +121,7 @@ class UserListItem extends Component {
|
||||
let allowedToResetStatus = hasAuthority && user.emoji.status != 'none';
|
||||
|
||||
// if currentUser is a moderator, allow kicking other users
|
||||
let allowedToKick = currentUser.isModerator && !user.isCurrent;
|
||||
let allowedToKick = currentUser.isModerator && !user.isCurrent && !isBreakoutRoom;
|
||||
|
||||
let allowedToSetPresenter = (currentUser.isModerator || currentUser.isPresenter) && !user.isPresenter;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user