Merge pull request #3531 from JaeeunCho/muteIcon
HTML5 Client userlist - added muted/unmuted button for the current user
This commit is contained in:
commit
20eea9cb06
@ -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 {
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user