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/api/server/helpers/insertUserObject.js

18 lines
358 B

import { Users } from 'meteor/rocketchat:models';
import { API } from '../api';
API.helperMethods.set('insertUserObject', function _addUserToObject({ object, userId }) {
const user = Users.findOneById(userId);
object.user = { };
if (user) {
object.user = {
_id: userId,
username: user.username,
name: user.name,
};
}
return object;
});