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

15 lines
429 B

Meteor.methods({
'livechat:setCustomField'(token, key, value) {
const customField = RocketChat.models.LivechatCustomField.findOneById(key);
if (customField) {
if (customField.scope === 'room') {
return RocketChat.models.Rooms.updateLivechatDataByToken(token, key, value);
} else {
// Save in user
return RocketChat.models.Users.updateLivechatDataByToken(token, key, value);
}
}
return true;
}
});