app/cluster.go: add PublishWebSocketEvent method (#20171)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-05-10 17:25:57 +03:00
коммит произвёл GitHub
родитель 8f7b501dd5
Коммит 81700598ec

Просмотреть файл

@@ -43,6 +43,12 @@ func (s *clusterWrapper) PublishPluginClusterEvent(productID string, ev model.Pl
return nil
}
func (s *clusterWrapper) PublishWebSocketEvent(productID string, event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast) {
ev := model.NewWebSocketEvent(fmt.Sprintf("custom_%v_%v", productID, event), "", "", "", nil)
ev = ev.SetBroadcast(broadcast).SetData(payload)
s.srv.Publish(ev)
}
func (s *clusterWrapper) SetPluginKeyWithOptions(productID string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
return s.srv.setPluginKeyWithOptions(productID, key, value, options)
}