diff options
Diffstat (limited to 'api/web_conn.go')
-rw-r--r-- | api/web_conn.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/api/web_conn.go b/api/web_conn.go index 52b5ba9de..c906b7c95 100644 --- a/api/web_conn.go +++ b/api/web_conn.go @@ -8,6 +8,7 @@ import ( "time" "github.com/mattermost/platform/model" + "github.com/mattermost/platform/utils" l4g "github.com/alecthomas/log4go" "github.com/gorilla/websocket" @@ -142,6 +143,13 @@ func (webCon *WebConn) isAuthenticated() bool { return webCon.SessionToken != "" } +func (webCon *WebConn) SendHello() { + msg := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_HELLO, "", "", webCon.UserId, nil) + msg.Add("server_version", fmt.Sprintf("%v.%v.%v", model.CurrentVersion, model.BuildNumber, utils.CfgHash)) + msg.DoPreComputeJson() + webCon.Send <- msg +} + func (webCon *WebConn) ShouldSendEvent(msg *model.WebSocketEvent) bool { // IMPORTANT: Do not send event if WebConn does not have a session if !webCon.isAuthenticated() { |