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/e2e/server/methods/updateGroupKey.js

15 lines
486 B

import { Meteor } from 'meteor/meteor';
import { Subscriptions } from '../../../models';
Meteor.methods({
'e2e.updateGroupKey'(rid, uid, key) {
const mySub = Subscriptions.findOneByRoomIdAndUserId(rid, Meteor.userId());
if (mySub) { // I have a subscription to this room
const userSub = Subscriptions.findOneByRoomIdAndUserId(rid, uid);
if (userSub) { // uid also has subscription to this room
return Subscriptions.updateGroupE2EKey(userSub._id, key);
}
}
},
});