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/app/livechat/server/methods/loadHistory.js

16 lines
428 B

import { Meteor } from 'meteor/meteor';
import { loadMessageHistory } from '../../../lib';
import { LivechatVisitors } from '../../../models';
Meteor.methods({
'livechat:loadHistory'({ token, rid, end, limit = 20, ls }) {
const visitor = LivechatVisitors.getVisitorByToken(token, { fields: { _id: 1 } });
if (!visitor) {
return;
}
return loadMessageHistory({ userId: visitor._id, rid, end, limit, ls });
},
});