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/patches/fetchContactHistory.ts

21 lines
603 B

import { License } from '@rocket.chat/license';
import { LivechatRooms } from '@rocket.chat/models';
import { fetchContactHistory } from '../../../app/livechat/server/lib/contacts/getContactHistory';
fetchContactHistory.patch(
async (next, params) => {
const { contactId, options, extraParams } = params;
if (!extraParams?.source || typeof extraParams.source !== 'string') {
return next(params);
}
return LivechatRooms.findClosedRoomsByContactAndSourcePaginated({
contactId,
source: extraParams.source,
options,
});
},
() => License.hasModule('contact-id-verification'),
);