summaryrefslogtreecommitdiffstats
path: root/app/plugin.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-07-05 10:23:55 -0400
committerChristopher Speller <crspeller@gmail.com>2018-07-05 07:23:55 -0700
commit7bfb5aec26c6bb8c49fa19e8347bc91acc86fe92 (patch)
tree6e62d8756c483e67611c9d66b10b0435c97f8bda /app/plugin.go
parent83a3ac089cff0d05559e6ba5c2c60b09f5cae176 (diff)
downloadchat-7bfb5aec26c6bb8c49fa19e8347bc91acc86fe92.tar.gz
chat-7bfb5aec26c6bb8c49fa19e8347bc91acc86fe92.tar.bz2
chat-7bfb5aec26c6bb8c49fa19e8347bc91acc86fe92.zip
Add back enable/disable WS events (#9052)
Diffstat (limited to 'app/plugin.go')
-rw-r--r--app/plugin.go12
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)
}