Skip to content
Snippets Groups Projects
Commit abe1cd3b authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Replace all ChatReports

parent e1597e61
No related merge requests found
......@@ -72,6 +72,7 @@ Package.onUse(function(api) {
api.addFiles('server/models/Subscriptions.coffee', 'server');
api.addFiles('server/models/Rooms.coffee', 'server');
api.addFiles('server/models/Messages.coffee', 'server');
api.addFiles('server/models/Reports.coffee', 'server');
// TAPi18n -- needs to be added last
api.addFiles(tapi18nFiles, ["client", "server"]);
......
RocketChat.models.Reports = new class asd extends RocketChat.models._Base
constructor: ->
@model = new Meteor.Collection 'rocketchat_reports'
# INSERT
createWithMessageDescriptionAndUserId: (message, description, userId, extraData) ->
record =
message: message
description: description
ts: new Date()
userId: userId
_.extend record, extraData
record._id = @insert record
return record
@ChatReports = new Meteor.Collection 'rocketchat_reports'
......@@ -6,8 +6,4 @@ Meteor.methods
if not description? or description.trim() is ''
throw new Meteor.Error 'invalid-description', "[methods] reportMessage -> Invalid description"
ChatReports.insert
message: message
description: description
ts: new Date()
userId: Meteor.userId()
RocketChat.models.Reports.createWithMessageDescriptionAndUserId message, description, Meteor.userId()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment