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/server/methods/reportMessage.coffee

9 lines
420 B

Meteor.methods
reportMessage: (message, description) ->
if not Meteor.userId()
throw new Meteor.Error 'invalid-user', "[methods] reportMessage -> Invalid user"
if not description? or description.trim() is ''
throw new Meteor.Error 'invalid-description', "[methods] reportMessage -> Invalid description"
RocketChat.models.Reports.createWithMessageDescriptionAndUserId message, description, Meteor.userId()