MM-10703 Adding blank request context to plugin hooks for future use. (#9043)
* Adding blank request context to plugin hooks for future use. * Rename RequestContext to Context * Adding context to ServeHTTP and ExecuteCommand * Fixing import cycle in test.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
7bfb5aec26
Коммит
4c1ddcff10
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/plugin"
|
||||
)
|
||||
|
||||
type PluginCommand struct {
|
||||
@@ -104,7 +105,7 @@ func (a *App) ExecutePluginCommand(args *model.CommandArgs) (*model.Command, *mo
|
||||
if err != nil {
|
||||
return pc.Command, nil, model.NewAppError("ExecutePluginCommand", "model.plugin_command.error.app_error", nil, "err="+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
response, appErr := pluginHooks.ExecuteCommand(args)
|
||||
response, appErr := pluginHooks.ExecuteCommand(plugin.NewBlankContext(), args)
|
||||
return pc.Command, response, appErr
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user