[FIX] "Click to Join" button is not working if there are no muted users in the room (#22871)

* Fix room.muted undefined error

* Remove unnecessary includes function calls

Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
pull/22396/head^2
Matheus Barbosa Silva 5 years ago committed by GitHub
parent 4b23ca5c10
commit 14f8379844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/authorization/server/functions/canSendMessage.js
  2. 2
      app/lib/server/lib/processDirectEmail.js
  3. 2
      app/videobridge/client/actionLink.js

@ -33,7 +33,7 @@ export const validateRoomMessagePermissionsAsync = async (room, { uid, username,
}
}
if ((room.muted || []).includes(username)) {
if (room?.muted?.includes(username)) {
throw new Error('You_have_been_muted');
}
};

@ -87,7 +87,7 @@ export const processDirectEmail = function(email) {
return false;
}
if ((room.muted || []).includes(user.username)) {
if (room?.muted?.includes(user.username)) {
// user is muted
return false;
}

@ -15,7 +15,7 @@ actionLinks.register('joinJitsiCall', function(message, params, instance) {
const currentTime = new Date().getTime();
const jitsiTimeout = new Date((room && room.jitsiTimeout) || currentTime).getTime();
if (room && room.muted.includes(username)) {
if (room && room?.muted?.includes(username)) {
toastr.error(TAPi18n.__('You_have_been_muted', ''));
} else if (jitsiTimeout > currentTime) {
instance.tabBar.open('video');

Loading…
Cancel
Save