PLT-5284 Fix webhook notifications for channel creator is not in (#5119)

* Fix webhook notifications for channel creator is not in

* Fix unit test
Этот коммит содержится в:
Joram Wilander
2017-01-20 09:43:14 -05:00
коммит произвёл Christopher Speller
родитель 6aec2b6c55
Коммит e8d7701b60
3 изменённых файлов: 15 добавлений и 17 удалений

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

@@ -99,10 +99,6 @@ func handlePostEvents(post *model.Post, teamId string, triggerWebhooks bool) *mo
channel = result.Data.(*model.Channel)
}
if _, err := SendNotifications(post, team, channel); err != nil {
return err
}
var user *model.User
if result := <-uchan; result.Err != nil {
return result.Err
@@ -110,6 +106,10 @@ func handlePostEvents(post *model.Post, teamId string, triggerWebhooks bool) *mo
user = result.Data.(*model.User)
}
if _, err := SendNotifications(post, team, channel, user); err != nil {
return err
}
if triggerWebhooks {
go func() {
if err := handleWebhookEvents(post, team, channel, user); err != nil {