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-snippet/client/snippetMessage.js

25 lines
662 B

Meteor.methods({
snippetMessage: function(message) {
if (typeof Meteor.userId() === 'undefined' || Meteor.userId() === null) {
return false;
}
if ((typeof RocketChat.settings.get('Message_AllowSnippeting') === 'undefined') ||
(RocketChat.settings.get('Message_AllowSnippeting') === null) ||
(RocketChat.settings.get('Message_AllowSnippeting') === false)) {
return false;
}
let subscription = RocketChat.models.Subscriptions.findOne({ rid: message.rid, 'u._id': Meteor.userId() });
if (subscription === undefined) {
return false;
}
ChatMessage.update({
_id: message._id
}, {
$set: {
snippeted: true
}
});
}
});