Fix #1709 hide mentions for edited messages when keep history is enabled

pull/1733/head
Marcelo Schmidt 10 years ago
parent ac4fa32750
commit a9febe8d13
  1. 3
      packages/rocketchat-lib/server/models/Messages.coffee
  2. 2
      packages/rocketchat-mentions-flextab/server/publications/mentionedMessages.coffee

@ -24,8 +24,9 @@ RocketChat.models.Messages = new class extends RocketChat.models._Base
return @find query, options
findByMentionAndRoomId: (username, rid, options) ->
findVisibleByMentionAndRoomId: (username, rid, options) ->
query =
_hidden: { $ne: true }
"mentions.username": username
"rid": rid

@ -8,7 +8,7 @@ Meteor.publish 'mentionedMessages', (rid, limit=50) ->
unless user
return this.ready()
cursorHandle = RocketChat.models.Messages.findByMentionAndRoomId(user.username, rid, { sort: { ts: -1 }, limit: limit }).observeChanges
cursorHandle = RocketChat.models.Messages.findVisibleByMentionAndRoomId(user.username, rid, { sort: { ts: -1 }, limit: limit }).observeChanges
added: (_id, record) ->
record.mentionedList = true
publication.added('rocketchat_mentioned_message', _id, record)

Loading…
Cancel
Save