diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/command.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/command.go b/app/command.go index 4c26eae71..fa9b38bf3 100644 --- a/app/command.go +++ b/app/command.go @@ -274,28 +274,34 @@ func (a *App) HandleCommandResponse(command *model.Command, args *model.CommandA post.Type = response.Type post.Props = response.Props - if !builtIn { - post.AddProp("from_webhook", "true") - } + isBotPost := !builtIn if a.Config().ServiceSettings.EnablePostUsernameOverride { if len(command.Username) != 0 { post.AddProp("override_username", command.Username) + isBotPost = true } else if len(response.Username) != 0 { post.AddProp("override_username", response.Username) + isBotPost = true } } if a.Config().ServiceSettings.EnablePostIconOverride { if len(command.IconURL) != 0 { post.AddProp("override_icon_url", command.IconURL) + isBotPost = true } else if len(response.IconURL) != 0 { post.AddProp("override_icon_url", response.IconURL) + isBotPost = true } else { post.AddProp("override_icon_url", "") } } + if isBotPost { + post.AddProp("from_webhook", "true") + } + // Process Slack text replacements response.Text = a.ProcessSlackText(response.Text) response.Attachments = a.ProcessSlackAttachments(response.Attachments) |