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

Allow post messages starting with slash

parent 7489a2d0
No related branches found
No related tags found
No related merge requests found
......@@ -99,14 +99,15 @@ class @ChatMessages
#Check if message starts with /command
if msg[0] is '/'
match = msg.match(/^\/([^\s]+)(?:\s+(.*))?$/m)
if(match?)
if match? and RocketChat.slashCommands.commands[match[1]]
command = match[1]
param = match[2]
Meteor.call 'slashCommand', {cmd: command, params: param, msg: msgObject }
else
#Run to allow local encryption
#Meteor.call 'onClientBeforeSendMessage', {}
Meteor.call 'sendMessage', msgObject
return
#Run to allow local encryption
#Meteor.call 'onClientBeforeSendMessage', {}
Meteor.call 'sendMessage', msgObject
deleteMsg: (message) ->
Meteor.call 'deleteMessage', message, (error, result) ->
......
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