From d7976549a0b45a42c04ac043a15677b7ca1228e9 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 27 Jun 2018 08:46:38 -0400 Subject: MM-9674 Add plugin API for publishing custom WebSocket events (#8999) * Add plugin API for publishing custom WebSocket events * Add clearer payload comment * Update comment --- plugin/api.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugin/api.go') diff --git a/plugin/api.go b/plugin/api.go index ed2bfa733..842cef4f6 100644 --- a/plugin/api.go +++ b/plugin/api.go @@ -113,6 +113,12 @@ type API interface { // Delete will remove a key-value pair. Returns nil for non-existent keys. KVDelete(key string) *model.AppError + + // PublishWebSocketEvent sends an event to WebSocket connections. + // event is the type and will be prepended with "custom__" + // payload is the data sent with the event. Interface values must be primitive Go types or mattermost-server/model types + // broadcast determines to which users to send the event + PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast) } var Handshake = plugin.HandshakeConfig{ -- cgit v1.2.3-1-g7c22