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/app/lib/server/functions/attachMessage.js

15 lines
431 B

import { getUserAvatarURL } from '../../../utils/lib/getUserAvatarURL';
import { roomTypes } from '../../../utils';
export const attachMessage = function(message, room) {
const { msg, u: { username }, ts, attachments, _id } = message;
return {
text: msg,
author_name: username,
author_icon: getUserAvatarURL(username),
message_link: `${ roomTypes.getRouteLink(room.t, room) }?msg=${ _id }`,
attachments,
ts,
};
};