summaryrefslogtreecommitdiffstats
path: root/app/post.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-01-20 09:43:14 -0500
committerChristopher Speller <crspeller@gmail.com>2017-01-20 09:43:14 -0500
commite8d7701b60e8285568ed01c2fe155ed02c388136 (patch)
tree65eb8631407a2f3e13d1c082e10c58b571988a2f /app/post.go
parent6aec2b6c55e63faac64d78c8c5c52b3a9e02b2c8 (diff)
downloadchat-e8d7701b60e8285568ed01c2fe155ed02c388136.tar.gz
chat-e8d7701b60e8285568ed01c2fe155ed02c388136.tar.bz2
chat-e8d7701b60e8285568ed01c2fe155ed02c388136.zip
PLT-5284 Fix webhook notifications for channel creator is not in (#5119)
* Fix webhook notifications for channel creator is not in * Fix unit test
Diffstat (limited to 'app/post.go')
-rw-r--r--app/post.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/post.go b/app/post.go
index 7eebe905f..f37ce8ad3 100644
--- a/app/post.go
+++ b/app/post.go
@@ -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 {