Skip to content
Snippets Groups Projects
Commit 8d2f2fe2 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

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

parent d0d559fc
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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