Skip to content
Snippets Groups Projects
Commit 58b337b0 authored by Gabriel Engel's avatar Gabriel Engel
Browse files

Embedded RocketBot in ALL ROOMS

parent 73ea68cd
No related branches found
No related tags found
No related merge requests found
Meteor.methods
sendMessage: (message) ->
if not Meteor.userId()
throw new Meteor.Error('invalid-user', "[methods] sendMessage -> Invalid user")
console.log '[methods] sendMessage -> '.green, 'userId:', Meteor.userId(), 'arguments:', arguments
user = Meteor.users.findOne Meteor.userId(), fields: username: 1
room = Meteor.call 'canAccessRoom', message.rid, user._id
if not room
return false
RocketChat.sendMessage user, message, room
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