Skip to content
Snippets Groups Projects
Commit 1857d4ec authored by Reid Wakida's avatar Reid Wakida
Browse files

Fix RocketChat/Rocket.Chat#239 room's message count and last message

timestamp is not updated when a message is sent.

The ChatRoom update selector referenced the wrong (non-existant) field.
Thus, the room's message count was never incremented.  Also fixes issue
where the room's last message timestamp is not set on the room document.
parent ff47efe8
No related branches found
No related tags found
No related merge requests found
...@@ -45,12 +45,12 @@ RocketChat.sendMessage = (user, message, room) -> ...@@ -45,12 +45,12 @@ RocketChat.sendMessage = (user, message, room) ->
ChatRoom.update ChatRoom.update
# only subscriptions to the same room # only subscriptions to the same room
rid: message.rid _id: message.rid
, ,
# update the last message timestamp # update the last message timestamp
$set: $set:
lm: message.ts lm: message.ts
# increate the messages counter # increment the messages counter
$inc: $inc:
msgs: 1 msgs: 1
......
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