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/api/chat.ts

27 lines
672 B

import { Meteor } from 'meteor/meteor';
import { API } from '../../../app/api/server/api';
import { hasLicense } from '../../app/license/server/license';
API.v1.addRoute(
'chat.getMessageReadReceipts',
{ authRequired: true },
{
async get() {
if (!hasLicense('message-read-receipt')) {
throw new Meteor.Error('error-action-not-allowed', 'This is an enterprise feature');
}
const { messageId } = this.queryParams;
if (!messageId) {
return API.v1.failure({
error: "The required 'messageId' param is missing.",
});
}
return API.v1.success({
receipts: await Meteor.callAsync('getReadReceipts', { messageId }),
});
},
},
);