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-message-star/client/starMessage.js

24 lines
527 B

import { Meteor } from 'meteor/meteor';
import { settings } from 'meteor/rocketchat:settings';
import { ChatMessage, Subscriptions } from 'meteor/rocketchat:models';
Meteor.methods({
starMessage(message) {
if (!Meteor.userId()) {
return false;
}
if (Subscriptions.findOne({ rid: message.rid }) == null) {
return false;
}
if (!settings.get('Message_AllowStarring')) {
return false;
}
return ChatMessage.update({
_id: message._id,
}, {
$set: {
starred: !!message.starred,
},
});
},
});