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/client/startup/notifications/updateAvatar.ts

16 lines
468 B

import { Meteor } from 'meteor/meteor';
import { Notifications } from '../../../app/notifications/client';
import { IUser } from '../../../definition/IUser';
type UpdateAvatarEvent = {
username: IUser['username'];
etag: IUser['avatarETag'];
};
Meteor.startup(() => {
Notifications.onLogged('updateAvatar', (data: UpdateAvatarEvent) => {
const { username, etag } = data;
username && Meteor.users.update({ username }, { $set: { avatarETag: etag } });
});
});