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

22 lines
713 B

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