MM-14795 Added "from_webhook" to protected props in DoPostAction (#10593)
Per @hanzei's request https://github.com/mattermost/mattermost-server/pull/10546#issuecomment-481997493 https://mattermost.atlassian.net/browse/MM-14795
Этот коммит содержится в:
@@ -328,6 +328,7 @@ func TestPostActionProps(t *testing.T) {
|
|||||||
"has_reactions": true,
|
"has_reactions": true,
|
||||||
"is_pinned": false,
|
"is_pinned": false,
|
||||||
"props": {
|
"props": {
|
||||||
|
"from_webhook":true,
|
||||||
"override_username":"new_override_user",
|
"override_username":"new_override_user",
|
||||||
"override_icon_url":"new_override_icon",
|
"override_icon_url":"new_override_icon",
|
||||||
"A":"AA"
|
"A":"AA"
|
||||||
@@ -366,6 +367,7 @@ func TestPostActionProps(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"override_icon_url": "old_override_icon",
|
"override_icon_url": "old_override_icon",
|
||||||
|
"from_webhook": false,
|
||||||
"B": "BB",
|
"B": "BB",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -390,6 +392,7 @@ func TestPostActionProps(t *testing.T) {
|
|||||||
assert.Nil(t, newPost.Props["override_username"])
|
assert.Nil(t, newPost.Props["override_username"])
|
||||||
assert.Equal(t, "AA", newPost.Props["A"])
|
assert.Equal(t, "AA", newPost.Props["A"])
|
||||||
assert.Equal(t, "old_override_icon", newPost.Props["override_icon_url"])
|
assert.Equal(t, "old_override_icon", newPost.Props["override_icon_url"])
|
||||||
|
assert.Equal(t, false, newPost.Props["from_webhook"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSubmitInteractiveDialog(t *testing.T) {
|
func TestSubmitInteractiveDialog(t *testing.T) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const (
|
|||||||
INTERACTIVE_DIALOG_TRIGGER_TIMEOUT_MILLISECONDS = 3000
|
INTERACTIVE_DIALOG_TRIGGER_TIMEOUT_MILLISECONDS = 3000
|
||||||
)
|
)
|
||||||
|
|
||||||
var PostActionRetainPropKeys = []string{"override_username", "override_icon_url"}
|
var PostActionRetainPropKeys = []string{"from_webhook", "override_username", "override_icon_url"}
|
||||||
|
|
||||||
type DoPostActionRequest struct {
|
type DoPostActionRequest struct {
|
||||||
SelectedOption string `json:"selected_option,omitempty"`
|
SelectedOption string `json:"selected_option,omitempty"`
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user