The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/server/lib/systemMessage/hideSystemMessage.ts

15 lines
648 B

import type { MessageTypesValues } from '@rocket.chat/core-typings';
export const isMutedUnmuted = (messageType: string): boolean => {
return messageType === 'user-muted' || messageType === 'user-unmuted';
};
export const isMessageRemoved = (messageType: string): boolean => messageType === 'rm';
export const shouldHideSystemMessage = (messageType: MessageTypesValues, hideSystemMessage?: MessageTypesValues[]): boolean => {
if (!hideSystemMessage?.length || isMessageRemoved(messageType)) {
return false;
}
return hideSystemMessage.includes(messageType) || (isMutedUnmuted(messageType) && hideSystemMessage.includes('mute_unmute'));
};