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

16 lines
553 B

import { Users } from '../../../models/server';
import { Notifications } from '../../../notifications/server';
Users.on('change', ({ clientAction, id, data, diff }) => {
switch (clientAction) {
case 'updated':
Notifications.notifyUserInThisInstance(id, 'userData', { diff, type: clientAction });
break;
case 'inserted':
Notifications.notifyUserInThisInstance(id, 'userData', { data, type: clientAction });
break;
case 'removed':
Notifications.notifyUserInThisInstance(id, 'userData', { id, type: clientAction });
break;
}
});