Don't allow users to be added to a channel they are not in the team of (#3246)

Этот коммит содержится в:
Joram Wilander
2016-06-04 10:52:25 -04:00
родитель 8d09c58b4d
Коммит 971149d2b2
6 изменённых файлов: 32 добавлений и 8 удалений

Просмотреть файл

@@ -603,7 +603,10 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
mentionedUsersList := make([]string, 0, len(mentionedUserIds))
senderName := profileMap[post.UserId].Username
senderName := ""
if profile, ok := profileMap[post.UserId]; ok {
senderName = profile.Username
}
for id := range mentionedUserIds {
mentionedUsersList = append(mentionedUsersList, id)