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/client/sidebar/RoomList/normalizeSidebarMessage.js

24 lines
621 B

import { filterMarkdown } from '../../../app/markdown/lib/markdown';
import { escapeHTML } from '../../../lib/escapeHTML';
export const normalizeSidebarMessage = (message, t) => {
if (message.msg) {
return escapeHTML(filterMarkdown(message.msg));
}
if (message.attachments) {
const attachment = message.attachments.find(
(attachment) => attachment.title || attachment.description,
);
if (attachment && attachment.description) {
return escapeHTML(attachment.description);
}
if (attachment && attachment.title) {
return escapeHTML(attachment.title);
}
return t('Sent_an_attachment');
}
};