RocketChat/Rocket.Chat

View on GitHub
apps/meteor/app/lib/server/functions/isTheLastMessage.ts

Summary

Maintainability
A
0 mins
Test Coverage
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);