diff options
Diffstat (limited to 'app/plugin.go')
-rw-r--r-- | app/plugin.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/plugin.go b/app/plugin.go index af4bae649..d68579311 100644 --- a/app/plugin.go +++ b/app/plugin.go @@ -170,6 +170,12 @@ func (a *App) EnablePlugin(id string) *model.AppError { cfg.PluginSettings.PluginStates[id] = &model.PluginState{Enable: true} }) + if manifest.HasClient() { + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PLUGIN_ENABLED, "", "", "", nil) + message.Add("manifest", manifest.ClientManifest()) + a.Publish(message) + } + // This call will cause SyncPluginsActiveState to be called and the plugin to be activated if err := a.SaveConfig(a.Config(), true); err != nil { if err.Id == "ent.cluster.save_config.error" { @@ -208,6 +214,12 @@ func (a *App) DisablePlugin(id string) *model.AppError { cfg.PluginSettings.PluginStates[id] = &model.PluginState{Enable: false} }) + if manifest.HasClient() { + message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PLUGIN_DISABLED, "", "", "", nil) + message.Add("manifest", manifest.ClientManifest()) + a.Publish(message) + } + if err := a.SaveConfig(a.Config(), true); err != nil { return model.NewAppError("DisablePlugin", "app.plugin.config.app_error", nil, err.Error(), http.StatusInternalServerError) } |