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

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

parent ac4fa327
No related branches found
No related tags found
No related merge requests found
...@@ -24,8 +24,9 @@ RocketChat.models.Messages = new class extends RocketChat.models._Base ...@@ -24,8 +24,9 @@ RocketChat.models.Messages = new class extends RocketChat.models._Base
return @find query, options return @find query, options
findByMentionAndRoomId: (username, rid, options) -> findVisibleByMentionAndRoomId: (username, rid, options) ->
query = query =
_hidden: { $ne: true }
"mentions.username": username "mentions.username": username
"rid": rid "rid": rid
......
...@@ -8,7 +8,7 @@ Meteor.publish 'mentionedMessages', (rid, limit=50) -> ...@@ -8,7 +8,7 @@ Meteor.publish 'mentionedMessages', (rid, limit=50) ->
unless user unless user
return this.ready() 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) -> added: (_id, record) ->
record.mentionedList = true record.mentionedList = true
publication.added('rocketchat_mentioned_message', _id, record) publication.added('rocketchat_mentioned_message', _id, record)
......
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