Skip to content
Snippets Groups Projects
Unverified Commit 8292c8e4 authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Remove unused options parameter from sendMessage

parent 6ceabf6c
No related branches found
No related tags found
No related merge requests found
## NEXT
- Remove unused options parameter from sendMessage
## 0.28.0, 2016-Apr-25
- Add "by" and "at" to language files
......
RocketChat.sendMessage = (user, message, room, options) ->
RocketChat.sendMessage = (user, message, room) ->
if not user or not message or not room._id
return false
......@@ -18,10 +18,7 @@ RocketChat.sendMessage = (user, message, room, options) ->
message = RocketChat.callbacks.run 'beforeSaveMessage', message
if message._id? and options?.upsert is true
RocketChat.models.Messages.upsert {_id: message._id}, message
else
message._id = RocketChat.models.Messages.insert message
message._id = RocketChat.models.Messages.insert message
###
Defer other updates as their return is not interesting to the user
......
Meteor.methods
sendMessage: (message, options) ->
sendMessage: (message) ->
if message.msg?.length > RocketChat.settings.get('Message_MaxAllowedSize')
throw new Meteor.Error('error-message-size-exceeded', 'Message size exceeds Message_MaxAllowedSize', { method: 'sendMessage' })
......@@ -22,7 +22,7 @@ Meteor.methods
}
return false
RocketChat.sendMessage user, message, room, options
RocketChat.sendMessage user, message, room
# Limit a user to sending 5 msgs/second
# DDPRateLimiter.addRule
......
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