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

Only invite users to channels via mentions

parent a451e418
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ RocketChat.sendMessage = (user, message, room, options) ->
if mentionIds.length > 0
usersOfMention = Meteor.users.find({_id: {$in: mentionIds}}, {fields: {_id: 1, username: 1}}).fetch()
if mentionIds.indexOf('all') is -1
if room.t is 'c' and mentionIds.indexOf('all') is -1
for usersOfMentionItem in usersOfMention
if room.usernames.indexOf(usersOfMentionItem.username) is -1
Meteor.runAsUser usersOfMentionItem._id, ->
......
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