[GH-13968] Add "skip_slack_parsing" to PostActionIntegration… (#13976)

Этот коммит содержится в:
Someone
2020-03-26 14:27:55 +01:00
коммит произвёл GitHub
родитель 8812de2bf0
Коммит b12670c583
2 изменённых файлов: 9 добавлений и 3 удалений

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

@@ -239,11 +239,16 @@ func (a *App) DoPostActionWithCookie(postId, actionId, userId, selectedOption st
if response.EphemeralText != "" { if response.EphemeralText != "" {
ephemeralPost := &model.Post{ ephemeralPost := &model.Post{
Message: model.ParseSlackLinksToMarkdown(response.EphemeralText), Message: response.EphemeralText,
ChannelId: upstreamRequest.ChannelId, ChannelId: upstreamRequest.ChannelId,
RootId: rootPostId, RootId: rootPostId,
UserId: userId, UserId: userId,
} }
if !response.SkipSlackParsing {
ephemeralPost.Message = model.ParseSlackLinksToMarkdown(response.EphemeralText)
}
for key, value := range retain { for key, value := range retain {
ephemeralPost.AddProp(key, value) ephemeralPost.AddProp(key, value)
} }

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

@@ -173,8 +173,9 @@ type PostActionIntegrationRequest struct {
} }
type PostActionIntegrationResponse struct { type PostActionIntegrationResponse struct {
Update *Post `json:"update"` Update *Post `json:"update"`
EphemeralText string `json:"ephemeral_text"` 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 { type PostActionAPIResponse struct {