diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-06-04 10:52:25 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-06-04 10:52:25 -0400 |
commit | 971149d2b298b3408af7218c868ed0b3edd83c2e (patch) | |
tree | 86e082c9341ccd98bc6bf5894ce3ee7d14359550 /api/post.go | |
parent | 8d09c58b4dbfd9f9ad651e03263dc109d7680a47 (diff) | |
download | chat-971149d2b298b3408af7218c868ed0b3edd83c2e.tar.gz chat-971149d2b298b3408af7218c868ed0b3edd83c2e.tar.bz2 chat-971149d2b298b3408af7218c868ed0b3edd83c2e.zip |
Don't allow users to be added to a channel they are not in the team of (#3246)
Diffstat (limited to 'api/post.go')
-rw-r--r-- | api/post.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/api/post.go b/api/post.go index 831591784..cf83c4d0d 100644 --- a/api/post.go +++ b/api/post.go @@ -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) |