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/ee/server/models/raw/ReadReceipts.ts

19 lines
769 B

import type { ReadReceipt, RocketChatRecordDeleted } from '@rocket.chat/core-typings';
import type { IReadReceiptsModel } from '@rocket.chat/model-typings';
import type { Collection, FindCursor, Db, IndexDescription } from 'mongodb';
import { BaseRaw } from '../../../../server/models/raw/BaseRaw';
export class ReadReceiptsRaw extends BaseRaw<ReadReceipt> implements IReadReceiptsModel {
constructor(db: Db, trash?: Collection<RocketChatRecordDeleted<ReadReceipt>>) {
super(db, 'read_receipts', trash);
}
protected modelIndexes(): IndexDescription[] {
return [{ key: { roomId: 1, userId: 1, messageId: 1 }, unique: true }, { key: { messageId: 1 } }];
}
findByMessageId(messageId: string): FindCursor<ReadReceipt> {
return this.find({ messageId });
}
}