Skip to content

Commit

Permalink
Fix #239 room's message count and last message
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rwakida committed Jul 9, 2015
1 parent ff47efe commit 1857d4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/rocketchat-lib/server/sendMessage.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ RocketChat.sendMessage = (user, message, room) ->

ChatRoom.update
# only subscriptions to the same room
rid: message.rid
_id: message.rid
,
# update the last message timestamp
$set:
lm: message.ts
# increate the messages counter
# increment the messages counter
$inc:
msgs: 1

Expand Down

0 comments on commit 1857d4e

Please sign in to comment.