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

Change sendMessage to user insert and delete instead upsert to pass correct _id to aferSaveMessage

parent e85f4623
No related branches found
No related tags found
No related merge requests found
...@@ -107,19 +107,15 @@ Meteor.methods ...@@ -107,19 +107,15 @@ Meteor.methods
### ###
Save the message. If there was already a typing record, update it. Save the message. If there was already a typing record, update it.
### ###
ChatMessage.upsert message._id = ChatMessage.insert message
rid: message.rid
t: 't'
$and: [{ 'u._id': message.u._id }]
,
$set: message
$unset:
t: 1
expireAt: 1
Meteor.defer -> Meteor.defer ->
ChatMessage.remove
rid: message.rid
t: 't'
'u._id': message.u._id
message._id = Random.id() Meteor.defer ->
RocketChat.callbacks.run 'afterSaveMessage', message RocketChat.callbacks.run 'afterSaveMessage', message
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