From b12670c583daa06b7d1cab04d9a59073046717c2 Mon Sep 17 00:00:00 2001 From: Someone Date: Thu, 26 Mar 2020 14:27:55 +0100 Subject: [PATCH] =?UTF-8?q?[GH-13968]=20Add=20`"skip=5Fslack=5Fparsing"`?= =?UTF-8?q?=20to=20PostActionIntegration=E2=80=A6=20(#13976)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/integration_action.go | 7 ++++++- model/integration_action.go | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/integration_action.go b/app/integration_action.go index a19cc589d5..9047a80f7c 100644 --- a/app/integration_action.go +++ b/app/integration_action.go @@ -239,11 +239,16 @@ func (a *App) DoPostActionWithCookie(postId, actionId, userId, selectedOption st if response.EphemeralText != "" { ephemeralPost := &model.Post{ - Message: model.ParseSlackLinksToMarkdown(response.EphemeralText), + Message: response.EphemeralText, ChannelId: upstreamRequest.ChannelId, RootId: rootPostId, UserId: userId, } + + if !response.SkipSlackParsing { + ephemeralPost.Message = model.ParseSlackLinksToMarkdown(response.EphemeralText) + } + for key, value := range retain { ephemeralPost.AddProp(key, value) } diff --git a/model/integration_action.go b/model/integration_action.go index b682b85883..72661aecaa 100644 --- a/model/integration_action.go +++ b/model/integration_action.go @@ -173,8 +173,9 @@ type PostActionIntegrationRequest struct { } type PostActionIntegrationResponse struct { - Update *Post `json:"update"` - EphemeralText string `json:"ephemeral_text"` + Update *Post `json:"update"` + EphemeralText string `json:"ephemeral_text"` + SkipSlackParsing bool `json:"skip_slack_parsing"` // Set to `true` to skip the Slack-compatibility handling of Text. } type PostActionAPIResponse struct {