PLT-7212: fix missing webhook post attachments (#7011)

* fix missing webhook post attachments

* make ProcessSlackAttachments return a new slice instead of modifying it
Этот коммит содержится в:
Chris
2017-08-03 18:25:47 -05:00
коммит произвёл Christopher Speller
родитель dc884983e6
Коммит df1ff4ec97
5 изменённых файлов: 68 добавлений и 23 удалений

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

@@ -28,13 +28,13 @@ type IncomingWebhook struct {
}
type IncomingWebhookRequest struct {
Text string `json:"text"`
Username string `json:"username"`
IconURL string `json:"icon_url"`
ChannelName string `json:"channel"`
Props StringInterface `json:"props"`
Attachments SlackAttachments `json:"attachments"`
Type string `json:"type"`
Text string `json:"text"`
Username string `json:"username"`
IconURL string `json:"icon_url"`
ChannelName string `json:"channel"`
Props StringInterface `json:"props"`
Attachments []*SlackAttachment `json:"attachments"`
Type string `json:"type"`
}
func (o *IncomingWebhook) ToJson() string {
@@ -209,7 +209,7 @@ func IncomingWebhookRequestFromJson(data io.Reader) *IncomingWebhookRequest {
}
o.Text = ExpandAnnouncement(o.Text)
o.Attachments.Process()
o.Attachments = ProcessSlackAttachments(o.Attachments)
return o
}