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

17 lines
359 B

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