1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rocketchat_ynh.git synced 2024-09-03 20:16:25 +02:00
rocketchat_ynh/sources/programs/server/app/server/methods/reportMessage.coffee.js
2016-04-29 16:32:48 +02:00

26 lines
1.7 KiB
JavaScript

(function(){
/////////////////////////////////////////////////////////////////////////
// //
// server/methods/reportMessage.coffee.js //
// //
/////////////////////////////////////////////////////////////////////////
//
__coffeescriptShare = typeof __coffeescriptShare === 'object' ? __coffeescriptShare : {}; var share = __coffeescriptShare;
Meteor.methods({ // 1
reportMessage: function(message, description) { // 2
if (!Meteor.userId()) { // 3
throw new Meteor.Error('invalid-user', "[methods] reportMessage -> Invalid user");
} //
if ((description == null) || description.trim() === '') { // 6
throw new Meteor.Error('invalid-description', "[methods] reportMessage -> Invalid description");
} //
return RocketChat.models.Reports.createWithMessageDescriptionAndUserId(message, description, Meteor.userId());
} //
}); //
//
/////////////////////////////////////////////////////////////////////////
}).call(this);
//# sourceMappingURL=reportMessage.coffee.js.map