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/startup.js

28 lines
734 B

Meteor.startup(() => {
RocketChat.roomTypes.setPublish('l', (code) => {
return RocketChat.models.Rooms.findLivechatByCode(code, {
name: 1,
t: 1,
cl: 1,
u: 1,
usernames: 1,
v: 1,
livechatData: 1,
topic: 1,
tags: 1,
sms: 1,
code: 1,
open: 1
});
});
RocketChat.authz.addRoomAccessValidator(function(room, user) {
return room.t === 'l' && RocketChat.authz.hasPermission(user._id, 'view-livechat-rooms');
});
RocketChat.callbacks.add('beforeLeaveRoom', function(user) {
throw new Meteor.Error(TAPi18n.__('You_cant_leave_a_livechat_room_Please_use_the_close_button', {
lng: user.language || RocketChat.settings.get('language') || 'en'
}));
}, RocketChat.callbacks.priority.LOW);
});