Skip to content

Commit

Permalink
refactor: Remove optional return of room coordinator (#28592)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok authored Mar 23, 2023
1 parent 9f1297e commit e44c910
Show file tree
Hide file tree
Showing 36 changed files with 45 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function validateRoomMessagePermissionsAsync(
throw new Error('error-not-allowed');
}

if (roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.BLOCK, uid)) {
if (roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.BLOCK, uid)) {
const subscription = await Subscriptions.findOneByRoomIdAndUserId(room._id, uid, subscriptionOptions);
if (subscription && (subscription.blocked || subscription.blocker)) {
throw new Error('room_is_blocked');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const updateRoomName = async (rid, displayName) => {

export async function saveRoomName(rid, displayName, user, sendMessage = true) {
const room = Rooms.findOneById(rid);
if (roomCoordinator.getRoomDirectives(room.t)?.preventRenaming()) {
if (roomCoordinator.getRoomDirectives(room.t).preventRenaming()) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
function: 'RocketChat.saveRoomdisplayName',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const saveRoomType = function (rid, roomType, user, sendMessage = true) {
});
}

if (!roomCoordinator.getRoomDirectives(room.t)?.allowRoomSettingChange(room, RoomSettingsEnum.TYPE)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowRoomSettingChange(room, RoomSettingsEnum.TYPE)) {
throw new Meteor.Error('error-direct-room', "Can't change type of direct rooms", {
function: 'RocketChat.saveRoomType',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const validators: RoomSettingsValidators = {
},
async encrypted({ userId, value, room, rid }) {
if (value !== room.encrypted) {
if (!roomCoordinator.getRoomDirectives(room.t)?.allowRoomSettingChange(room, RoomSettingsEnum.E2E)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowRoomSettingChange(room, RoomSettingsEnum.E2E)) {
throw new Meteor.Error('error-action-not-allowed', 'Only groups or direct channels can enable encryption', {
method: 'saveRoomSettings',
action: 'Change_Room_Encrypted',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const create = async ({ prid, pmid, t_name: discussionName, reply, users, user,
// auto invite the replied message owner
const invitedUsers = message ? [message.u.username, ...users] : users;

const type = await roomCoordinator.getRoomDirectives(parentRoom.t)?.getDiscussionType(parentRoom);
const type = await roomCoordinator.getRoomDirectives(parentRoom.t).getDiscussionType(parentRoom);
const description = parentRoom.encrypted ? '' : message?.msg;
const topic = parentRoom.name;

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/e2e/client/rocketchat.e2e.room.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class E2ERoom extends Emitter {
}

isSupportedRoomType(type) {
return roomCoordinator.getRoomDirectives(type)?.allowRoomSettingChange({}, RoomSettingsEnum.E2E);
return roomCoordinator.getRoomDirectives(type).allowRoomSettingChange({}, RoomSettingsEnum.E2E);
}

async importGroupKey(groupKey) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/file-upload/server/lib/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export const FileUpload = {
}

const isAuthorizedByRoom = () =>
rc_room_type && roomCoordinator.getRoomDirectives(rc_room_type)?.canAccessUploadedFile({ rc_uid, rc_rid, rc_token });
rc_room_type && roomCoordinator.getRoomDirectives(rc_room_type).canAccessUploadedFile({ rc_uid, rc_rid, rc_token });
const isAuthorizedByJWT = () =>
settings.get('FileUpload_Enable_json_web_token_for_files') &&
token &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const findOrCreateInvite = async (userId, invite) => {
}

const room = Rooms.findOneById(invite.rid);
if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.INVITE, userId)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.INVITE, userId)) {
throw new Meteor.Error('error-room-type-not-allowed', 'Cannot create invite links for this room type', {
method: 'findOrCreateInvite',
});
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/invites/server/functions/useInviteToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const useInviteToken = async (userId, token) => {

const { inviteData, room } = await validateInviteToken(token);

if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.INVITE, userId)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.INVITE, userId)) {
throw new Meteor.Error('error-room-type-not-allowed', "Can't join room of this type via invite", {
method: 'useInviteToken',
field: 'token',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { settings } from '../../../../settings/server';
* @param {string} notificationMessage The message text to send on notification body
*/
export function notifyDesktopUser({ userId, user, message, room, duration, notificationMessage }) {
const { title, text } = roomCoordinator.getRoomDirectives(room.t)?.getNotificationDetails(room, user, notificationMessage, userId);
const { title, text } = roomCoordinator.getRoomDirectives(room.t).getNotificationDetails(room, user, notificationMessage, userId);

const payload = {
title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function getEmailData({ message, receiver, sender, subscription, room, em
const username = settings.get('UI_Use_Real_Name') ? message.u.name || message.u.username : message.u.username;
let subjectKey = 'Offline_Mention_All_Email';

if (!roomCoordinator.getRoomDirectives(room.t)?.isGroupChat(room)) {
if (!roomCoordinator.getRoomDirectives(room.t).isGroupChat(room)) {
subjectKey = 'Offline_DM_Email';
} else if (hasMentionToUser) {
subjectKey = 'Offline_Mention_Email';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function getPushData({
...(message.t === 'e2e' && { msg: message.msg }),
},
roomName:
settings.get('Push_show_username_room') && roomCoordinator.getRoomDirectives(room.t)?.isGroupChat(room)
settings.get('Push_show_username_room') && roomCoordinator.getRoomDirectives(room.t).isGroupChat(room)
? `#${roomCoordinator.getRoomName(room.t, room, userId)}`
: '',
username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export async function sendMessageNotifications(message, room, usersInThread = []
return;
}

const sender = roomCoordinator.getRoomDirectives(room.t)?.getMsgSender(message.u._id);
const sender = roomCoordinator.getRoomDirectives(room.t).getMsgSender(message.u._id);
if (!sender) {
return message;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/lib/server/methods/archiveRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Meteor.methods<ServerMethods>({
throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'archiveRoom' });
}

if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.ARCHIVE, userId)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.ARCHIVE, userId)) {
throw new Meteor.Error('error-direct-message-room', `rooms type: ${room.t} can not be archived`, { method: 'archiveRoom' });
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/lib/server/methods/blockUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Meteor.methods<ServerMethods>({

const room = Rooms.findOne({ _id: rid });

if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.BLOCK, userId)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.BLOCK, userId)) {
throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'blockUser' });
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/lib/server/methods/joinRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Meteor.methods<ServerMethods>({
throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'joinRoom' });
}

if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.JOIN, user._id)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.JOIN, user._id)) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'joinRoom' });
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/lib/server/methods/leaveRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Meteor.methods<ServerMethods>({
const room = Rooms.findOneById(rid);
const user = Meteor.user() as unknown as IUser;

if (!user || !roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.LEAVE, user._id)) {
if (!user || !roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.LEAVE, user._id)) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'leaveRoom' });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ slashCommands.add({
}

// You can not archive direct messages.
if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.ARCHIVE, userId)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.ARCHIVE, userId)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/ui-utils/client/lib/LegacyRoomManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const computation = Tracker.autorun(() => {
const type = typeName.slice(0, 1);
const name = typeName.slice(1);

const room = roomCoordinator.getRoomDirectives(type)?.findRoom(name);
const room = roomCoordinator.getRoomDirectives(type).findRoom(name);

void RoomHistoryManager.getMoreIfIsEmpty(record.rid);

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/ui-utils/client/lib/openRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function openRoom(type: RoomType, name: string, render = true) {
}

try {
const room = roomCoordinator.getRoomDirectives(type)?.findRoom(name) || (await call('getRoomByTypeAndName', type, name));
const room = roomCoordinator.getRoomDirectives(type).findRoom(name) || (await call('getRoomByTypeAndName', type, name));
if (!room._id) {
return;
}
Expand Down
12 changes: 6 additions & 6 deletions apps/meteor/client/lib/rooms/roomCoordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class RoomCoordinatorClient extends RoomCoordinator {
super.addRoute(path, { ...routeConfig, triggersExit: [roomExit] });
}

getRoomDirectives(roomType: string): IRoomTypeClientDirectives | undefined {
return this.roomTypes[roomType]?.directives as IRoomTypeClientDirectives;
getRoomDirectives(roomType: string): IRoomTypeClientDirectives {
return this.roomTypes[roomType].directives as IRoomTypeClientDirectives;
}

getRoomTypeById(rid: string): RoomType | undefined {
Expand All @@ -99,7 +99,7 @@ class RoomCoordinatorClient extends RoomCoordinator {
}

getIcon(room: Partial<IRoom>): IRoomTypeConfig['icon'] {
return room?.t && this.getRoomDirectives(room.t)?.getIcon(room);
return room?.t && this.getRoomDirectives(room.t).getIcon(room);
}

openRouteLink(roomType: RoomType, subData: RoomIdentification, queryParams?: Record<string, string>): void {
Expand All @@ -123,11 +123,11 @@ class RoomCoordinatorClient extends RoomCoordinator {
}

isLivechatRoom(roomType: string): boolean {
return Boolean(this.getRoomDirectives(roomType)?.isLivechatRoom());
return Boolean(this.getRoomDirectives(roomType).isLivechatRoom());
}

getRoomName(roomType: string, roomData: AtLeast<IRoom, '_id' | 'name' | 'fname' | 'prid'>): string {
return this.getRoomDirectives(roomType)?.roomName(roomData) ?? '';
return this.getRoomDirectives(roomType).roomName(roomData) ?? '';
}

readOnly(rid: string, user: AtLeast<IUser, 'username'>): boolean {
Expand Down Expand Up @@ -184,7 +184,7 @@ class RoomCoordinatorClient extends RoomCoordinator {
if (!room?.t) {
return false;
}
if (!this.getRoomDirectives(room.t)?.canSendMessage(rid)) {
if (!this.getRoomDirectives(room.t).canSendMessage(rid)) {
return false;
}
if (isRoomFederated(room)) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/providers/AvatarUrlProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const AvatarUrlProvider: FC = ({ children }) => {
return (uid: string, etag?: string): string => getURL(`/avatar/${uid}${etag ? `?etag=${etag}` : ''}`);
})(),
getRoomPathAvatar: ({ type, ...room }: any): string =>
roomCoordinator.getRoomDirectives(type || room.t)?.getAvatarPath({ username: room._id, ...room }) || '',
roomCoordinator.getRoomDirectives(type || room.t).getAvatarPath({ username: room._id, ...room }) || '',
}),
[externalProviderUrl, cdnAvatarUrl],
);
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/sidebar/RoomMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const RoomMenu = ({
closeModal();
};

const warnText = roomCoordinator.getRoomDirectives(type)?.getUiText(UiTextContext.LEAVE_WARNING);
const warnText = roomCoordinator.getRoomDirectives(type).getUiText(UiTextContext.LEAVE_WARNING);

setModal(
<WarningModal
Expand All @@ -148,7 +148,7 @@ const RoomMenu = ({
closeModal();
};

const warnText = roomCoordinator.getRoomDirectives(type)?.getUiText(UiTextContext.HIDE_WARNING);
const warnText = roomCoordinator.getRoomDirectives(type).getUiText(UiTextContext.HIDE_WARNING);

if (dontAskHideRoom) {
return hide();
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/admin/rooms/EditRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps): ReactElement =>

const [canViewName, canViewTopic, canViewAnnouncement, canViewArchived, canViewDescription, canViewType, canViewReadOnly] =
useMemo(() => {
const isAllowed = roomCoordinator.getRoomDirectives(room.t)?.allowRoomSettingChange;
const isAllowed = roomCoordinator.getRoomDirectives(room.t).allowRoomSettingChange;
return [
isAllowed?.(room, RoomSettingsEnum.NAME),
isAllowed?.(room, RoomSettingsEnum.TOPIC),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ChannelsTableRowProps = {
const ChannelsTableRow = ({ onClick, room, mediaQuery }: ChannelsTableRowProps) => {
const formatDate = useFormatDate();
const { _id, ts, t, name, fname, usersCount, lastMessage, topic, belongsTo } = room;
const avatarUrl = roomCoordinator.getRoomDirectives(t)?.getAvatarPath(room);
const avatarUrl = roomCoordinator.getRoomDirectives(t).getAvatarPath(room);

return (
<TableRow key={_id} onKeyDown={onClick(name, t)} onClick={onClick(name, t)} tabIndex={0} role='link' action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type TeamsTableRowProps = {
const TeamsTableRow = ({ onClick, team, mediaQuery }: TeamsTableRowProps) => {
const formatDate = useFormatDate();
const { _id, ts, t, name, fname, topic, roomsCount } = team;
const avatarUrl = roomCoordinator.getRoomDirectives(t)?.getAvatarPath(team);
const avatarUrl = roomCoordinator.getRoomDirectives(t).getAvatarPath(team);

return (
<TableRow key={_id} onKeyDown={onClick(name, t)} onClick={onClick(name, t)} tabIndex={0} role='link' action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ContactField = ({ contact, room }: ContactFieldProps) => {
const t = useTranslation();
const { status } = contact;
const { fname, t: type } = room;
const avatarUrl = roomCoordinator.getRoomDirectives(type)?.getAvatarPath(room) || '';
const avatarUrl = roomCoordinator.getRoomDirectives(type).getAvatarPath(room) || '';

const getVisitorInfo = useEndpoint('GET', '/v1/livechat/visitors.info');
const { data, isLoading, isError } = useQuery(['/v1/livechat/visitors.info', contact._id], () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function EditChannel({ room, onClickClose, onClickBack }) {
canViewJoinCode,
canViewEncrypted,
] = useMemo(() => {
const isAllowed = roomCoordinator.getRoomDirectives(room.t)?.allowRoomSettingChange || (() => {});
const isAllowed = roomCoordinator.getRoomDirectives(room.t).allowRoomSettingChange || (() => {});
return [
isAllowed(room, RoomSettingsEnum.NAME),
isAllowed(room, RoomSettingsEnum.TOPIC),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useRoomHide = (room: IRoom) => {
setModal(null);
};

const warnText = roomCoordinator.getRoomDirectives(room.t)?.getUiText(UiTextContext.HIDE_WARNING);
const warnText = roomCoordinator.getRoomDirectives(room.t).getUiText(UiTextContext.HIDE_WARNING);

setModal(
<WarningModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const useRoomLeave = (room: IRoom, joined = true) => {
setModal(null);
};

const warnText = roomCoordinator.getRoomDirectives(room.t)?.getUiText(UiTextContext.LEAVE_WARNING);
const warnText = roomCoordinator.getRoomDirectives(room.t).getUiText(UiTextContext.LEAVE_WARNING);

setModal(
<WarningModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const TeamsInfoWithLogic = ({ room, openEditing }) => {
}
};

const warnText = roomCoordinator.getRoomDirectives(room.t)?.getUiText(UiTextContext.HIDE_WARNING);
const warnText = roomCoordinator.getRoomDirectives(room.t).getUiText(UiTextContext.HIDE_WARNING);

if (dontAskHideRoom) {
return hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ReadReceipt = {
await MessagesRaw.setAsReadById(message._id);
}

const extraData = roomCoordinator.getRoomDirectives(t)?.getReadReceiptsExtraData(message);
const extraData = roomCoordinator.getRoomDirectives(t).getReadReceiptsExtraData(message);
this.storeReadReceipts([{ _id: message._id }], roomId, userId, extraData);
},

Expand Down
8 changes: 4 additions & 4 deletions apps/meteor/server/lib/rooms/roomCoordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class RoomCoordinatorServer extends RoomCoordinator {
});
}

getRoomDirectives(roomType: string): IRoomTypeServerDirectives | undefined {
return this.roomTypes[roomType]?.directives as IRoomTypeServerDirectives;
getRoomDirectives(roomType: string): IRoomTypeServerDirectives {
return this.roomTypes[roomType].directives as IRoomTypeServerDirectives;
}

openRoom(_type: string, _name: string, _render = true): void {
Expand All @@ -79,7 +79,7 @@ class RoomCoordinatorServer extends RoomCoordinator {
}

getRoomName(roomType: string, roomData: IRoom, userId?: string): string {
return this.getRoomDirectives(roomType)?.roomName(roomData, userId) ?? '';
return this.getRoomDirectives(roomType).roomName(roomData, userId) ?? '';
}

setRoomFind(roomType: string, roomFind: Required<Pick<IRoomTypeServerDirectives, 'roomFind'>>['roomFind']): void {
Expand All @@ -96,7 +96,7 @@ class RoomCoordinatorServer extends RoomCoordinator {
}

getRoomFind(roomType: string): Required<Pick<IRoomTypeServerDirectives, 'roomFind'>>['roomFind'] | undefined {
return this.getRoomDirectives(roomType)?.roomFind;
return this.getRoomDirectives(roomType).roomFind;
}

searchableRoomTypes(): Array<string> {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/server/methods/muteUserInRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Meteor.methods<ServerMethods>({
});
}

if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.MUTE, fromId)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.MUTE, fromId)) {
throw new Meteor.Error('error-invalid-room-type', `${room.t} is not a valid room type`, {
method: 'muteUserInRoom',
type: room.t,
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/server/methods/removeUserFromRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Meteor.methods<ServerMethods>({

const room = Rooms.findOneById(data.rid);

if (!room || !roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.REMOVE_USER, fromId)) {
if (!room || !roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.REMOVE_USER, fromId)) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
method: 'removeUserFromRoom',
});
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/server/methods/unmuteUserInRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Meteor.methods<ServerMethods>({
});
}

if (!roomCoordinator.getRoomDirectives(room.t)?.allowMemberAction(room, RoomMemberActions.MUTE, fromId)) {
if (!roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.MUTE, fromId)) {
throw new Meteor.Error('error-invalid-room-type', `${room.t} is not a valid room type`, {
method: 'unmuteUserInRoom',
type: room.t,
Expand Down

0 comments on commit e44c910

Please sign in to comment.