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),
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 {

View File

@ -110,10 +110,25 @@ class UserListItem extends Component {
setPresenter,
promote,
kick,
mute,
unmute,
} = 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([
(!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(setPresenter, user) : null),
(currentUser.isModerator ? this.renderUserAction(promote, user) : null),