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/imports/message-read-receipt/server/api/methods/getReadReceipts.js

20 lines
584 B

import { Meteor } from 'meteor/meteor';
import { ReadReceipt } from '../../lib/ReadReceipt';
Meteor.methods({
getReadReceipts({ messageId }) {
if (!Meteor.userId()) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'getReadReceipts' });
}
const message = RocketChat.models.Messages.findOneById(messageId);
const room = Meteor.call('canAccessRoom', message.rid, Meteor.userId());
if (!room) {
throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'getReadReceipts' });
}
return ReadReceipt.getReceipts(message);
}
});