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

Allow save mentions to 'all'

parent 7246f047
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,13 @@ class MentionsServer
mentions = _.unique mentions
verifiedMentions = []
mentions.forEach (mention) ->
verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
if mention is 'all'
verifiedMention =
_id: mention
username: mention
else
verifiedMention = Meteor.users.findOne({username: mention}, {fields: {_id: 1, username: 1}})
verifiedMentions.push verifiedMention if verifiedMention?
if verifiedMentions.length isnt 0
message.mentions = verifiedMentions
......
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