Merge pull request #3531 from JaeeunCho/muteIcon

HTML5 Client userlist - added muted/unmuted button for the current user
This commit is contained in:
Anton Georgiev 2016-12-21 13:04:45 -05:00 committed by GitHub
commit 20eea9cb06
2 changed files with 25 additions and 0 deletions

View File

@ -237,6 +237,16 @@ const userActions = {
handler: user => callServer('kickUser', user.userid), handler: user => callServer('kickUser', user.userid),
icon: 'kick-user', icon: 'kick-user',
}, },
mute: {
label: 'Mute Audio',
handler: user=> callServer('muteUser', Auth.userID),
icon: 'mute',
},
unmute: {
label: 'Unmute Audio',
handler: user=> callServer('unmuteUser', Auth.userID),
icon: 'unmute',
},
}; };
export default { export default {

View File

@ -110,10 +110,25 @@ class UserListItem extends Component {
setPresenter, setPresenter,
promote, promote,
kick, kick,
mute,
unmute,
} = userActions; } = userActions;
let muteAudio, unmuteAudio;
// Check the state of joining the audio currently for current user
if (user.isCurrent && user.isVoiceUser) {
if (user.isMuted) {
muteAudio = true;
} else {
unmuteAudio = true;
}
}
return _.compact([ return _.compact([
(!user.isCurrent ? this.renderUserAction(openChat, router, user) : null), (!user.isCurrent ? this.renderUserAction(openChat, router, user) : null),
(muteAudio ? this.renderUserAction(unmute, user) : null),
(unmuteAudio ? this.renderUserAction(mute, user) : null),
(currentUser.isModerator ? this.renderUserAction(clearStatus, user) : null), (currentUser.isModerator ? this.renderUserAction(clearStatus, user) : null),
(currentUser.isModerator ? this.renderUserAction(setPresenter, user) : null), (currentUser.isModerator ? this.renderUserAction(setPresenter, user) : null),
(currentUser.isModerator ? this.renderUserAction(promote, user) : null), (currentUser.isModerator ? this.renderUserAction(promote, user) : null),