From 8e19ba029f889519d93cf272960dce858971106c Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 18 Oct 2017 15:36:43 -0700 Subject: Reduce utils.Cfg references (#7650) * app.UpdateConfig method * test fix * another test fix * the config override option as-was is just error prone, remove it for now * derp --- app/plugins.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/plugins.go') diff --git a/app/plugins.go b/app/plugins.go index 9826674f1..ca3fe610c 100644 --- a/app/plugins.go +++ b/app/plugins.go @@ -295,7 +295,7 @@ func (a *App) ActivatePlugins() { } func (a *App) UnpackAndActivatePlugin(pluginFile io.Reader) (*model.Manifest, *model.AppError) { - if a.PluginEnv == nil || !*utils.Cfg.PluginSettings.Enable { + if a.PluginEnv == nil || !*a.Config().PluginSettings.Enable { return nil, model.NewAppError("UnpackAndActivatePlugin", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented) } @@ -346,7 +346,7 @@ func (a *App) UnpackAndActivatePlugin(pluginFile io.Reader) (*model.Manifest, *m } func (a *App) GetActivePluginManifests() ([]*model.Manifest, *model.AppError) { - if a.PluginEnv == nil || !*utils.Cfg.PluginSettings.Enable { + if a.PluginEnv == nil || !*a.Config().PluginSettings.Enable { return nil, model.NewAppError("GetActivePluginManifests", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented) } @@ -361,7 +361,7 @@ func (a *App) GetActivePluginManifests() ([]*model.Manifest, *model.AppError) { } func (a *App) RemovePlugin(id string) *model.AppError { - if a.PluginEnv == nil || !*utils.Cfg.PluginSettings.Enable { + if a.PluginEnv == nil || !*a.Config().PluginSettings.Enable { return model.NewAppError("RemovePlugin", "app.plugin.disabled.app_error", nil, "", http.StatusNotImplemented) } @@ -394,7 +394,7 @@ func (a *App) RemovePlugin(id string) *model.AppError { } func (a *App) InitPlugins(pluginPath, webappPath string) { - if !utils.IsLicensed() || !*utils.License().Features.FutureFeatures || !*utils.Cfg.PluginSettings.Enable { + if !utils.IsLicensed() || !*utils.License().Features.FutureFeatures || !*a.Config().PluginSettings.Enable { return } -- cgit v1.2.3-1-g7c22