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/app/lib/server/functions/isTheLastMessage.ts

7 lines
379 B

import type { IMessage, IRoom } from '@rocket.chat/core-typings';
import { settings } from '../../../settings/server';
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export const isTheLastMessage = (room: IRoom, message: Pick<IMessage, '_id'>) =>
settings.get('Store_Last_Message') && (!room.lastMessage || room.lastMessage._id === message._id);