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/lib/createQuoteAttachment.ts

16 lines
628 B

import { isTranslatedMessage } from '@rocket.chat/core-typings';
import type { ITranslatedMessage, IMessage } from '@rocket.chat/core-typings';
import { getUserAvatarURL } from '../app/utils/lib/getUserAvatarURL';
export function createQuoteAttachment(message: IMessage | ITranslatedMessage, messageLink: string) {
return {
text: message.msg,
...(isTranslatedMessage(message) && { translations: message?.translations }),
message_link: messageLink,
author_name: message.alias || message.u.username,
author_icon: getUserAvatarURL(message.u.username),
attachments: message.attachments || [],
ts: message.ts,
};
}