Render link to mention to 'all' without target to user 'all'

pull/398/head
Rodrigo Nascimento 11 years ago
parent d0d559fc3c
commit 8d2f2fe282
  1. 7
      packages/rocketchat-mentions/client.coffee

@ -15,6 +15,13 @@ class MentionsClient
mentions = _.unique mentions
mentions = mentions.join('|')
msg = msg.replace new RegExp("(?:^|\\s)(@(#{mentions}))(?:\\s|$)", 'g'), (match, mention, username) ->
if username is 'all'
return match.replace mention, "<a href=\"\" class=\"mention-link\">#{mention}</a>"
if not message.temp?
if not _.findWhere(message.mentions, {username: username})?
return match
return match.replace mention, "<a href=\"\" class=\"mention-link\" data-username=\"#{username}\">#{mention}</a>"
message.html = msg

Loading…
Cancel
Save