summaryrefslogtreecommitdiffstats
path: root/app/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/webhook.go')
-rw-r--r--app/webhook.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/webhook.go b/app/webhook.go
index 8926c94a8..e801b0467 100644
--- a/app/webhook.go
+++ b/app/webhook.go
@@ -133,7 +133,13 @@ func (a *App) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.
if len(webhookResp.Attachments) > 0 {
webhookResp.Props["attachments"] = webhookResp.Attachments
}
+ if a.Config().ServiceSettings.EnablePostUsernameOverride && hook.Username != "" && webhookResp.Username == "" {
+ webhookResp.Username = hook.Username
+ }
+ if a.Config().ServiceSettings.EnablePostIconOverride && hook.IconURL != "" && webhookResp.IconURL == "" {
+ webhookResp.IconURL = hook.IconURL
+ }
if _, err := a.CreateWebhookPost(hook.CreatorId, channel, text, webhookResp.Username, webhookResp.IconURL, webhookResp.Props, webhookResp.Type, postRootId); err != nil {
mlog.Error(fmt.Sprintf("Failed to create response post, err=%v", err))
}