added the custom icon and username for the outgoing webhook and its response (#9141)
* 8272 added the username and icon as part of the model and persisted the same * 8272 added the custome icon and name when set to the web hook response * 8272 changed the infinte loop to timeout after 5 seconds * 8272 fixed review comments
Этот коммит содержится в:
коммит произвёл
Jesse Hallam
родитель
b89ccca929
Коммит
b3c2ecd9b9
@@ -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))
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user