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/methods/leaveRoom.js

18 lines
252 B

Meteor.methods({
leaveRoom(rid) {
if (!Meteor.userId()) {
return false;
}
ChatSubscription.remove({
rid: rid,
'u._id': Meteor.userId()
});
ChatRoom.update(rid, {
$pull: {
usernames: Meteor.user().username
}
});
}
});