PLT-4096 fix error/panic on replying to integrations. (#4968)

Этот коммит содержится в:
George Goldberg
2017-01-06 14:02:37 +00:00
коммит произвёл Harrison Healey
родитель af01229ed8
Коммит bc08cc0ca5

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

@@ -624,13 +624,14 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
list := result.Data.(*model.PostList) list := result.Data.(*model.PostList)
for _, threadPost := range list.Posts { for _, threadPost := range list.Posts {
profile := profileMap[threadPost.UserId] if profile, ok := profileMap[threadPost.UserId]; ok {
if profile.NotifyProps["comments"] == "any" || (profile.NotifyProps["comments"] == "root" && threadPost.Id == list.Order[0]) { if profile.NotifyProps["comments"] == "any" || (profile.NotifyProps["comments"] == "root" && threadPost.Id == list.Order[0]) {
mentionedUserIds[threadPost.UserId] = true mentionedUserIds[threadPost.UserId] = true
} }
} }
} }
} }
}
// prevent the user from mentioning themselves // prevent the user from mentioning themselves
if post.Props["from_webhook"] != "true" { if post.Props["from_webhook"] != "true" {