diff options
author | Chris <ccbrown112@gmail.com> | 2017-09-27 11:52:34 -0500 |
---|---|---|
committer | Saturnino Abril <saturnino.abril@gmail.com> | 2017-09-28 00:52:34 +0800 |
commit | 8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df (patch) | |
tree | b3563dfe35ad78991774c9d1842dc439376e1db1 /api4 | |
parent | 1bd66589a2adc67df5df9c108a2f2ecc77dfdf44 (diff) | |
download | chat-8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df.tar.gz chat-8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df.tar.bz2 chat-8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df.zip |
remove remaining Global() calls (outside of tests) (#7521)
Diffstat (limited to 'api4')
-rw-r--r-- | api4/api.go | 2 | ||||
-rw-r--r-- | api4/apitestlib.go | 4 | ||||
-rw-r--r-- | api4/websocket.go | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/api4/api.go b/api4/api.go index 9df051456..e9cf3054c 100644 --- a/api4/api.go +++ b/api4/api.go @@ -226,7 +226,7 @@ func Init(a *app.App, root *mux.Router, full bool) *API { if full { utils.InitHTML() - app.InitEmailBatching() + a.InitEmailBatching() } return api diff --git a/api4/apitestlib.go b/api4/apitestlib.go index 7b5230014..fad066ff8 100644 --- a/api4/apitestlib.go +++ b/api4/apitestlib.go @@ -61,10 +61,10 @@ func setupTestHelper(enterprise bool) *TestHelper { th.App.NewServer() th.App.InitStores() th.App.Srv.Router = NewRouter() - wsapi.InitRouter() + th.App.Srv.WebSocketRouter = th.App.NewWebSocketRouter() th.App.StartServer() Init(th.App, th.App.Srv.Router, true) - wsapi.InitApi() + wsapi.Init(th.App, th.App.Srv.WebSocketRouter) utils.EnableDebugLogForTest() th.App.Srv.Store.MarkSystemRanUnitTests() diff --git a/api4/websocket.go b/api4/websocket.go index 7dfe3d61c..2793c0bd0 100644 --- a/api4/websocket.go +++ b/api4/websocket.go @@ -8,7 +8,6 @@ import ( l4g "github.com/alecthomas/log4go" "github.com/gorilla/websocket" - "github.com/mattermost/mattermost-server/app" "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" ) @@ -38,7 +37,7 @@ func connectWebSocket(c *Context, w http.ResponseWriter, r *http.Request) { wc := c.App.NewWebConn(ws, c.Session, c.T, "") if len(c.Session.UserId) > 0 { - app.HubRegister(wc) + c.App.HubRegister(wc) } go wc.WritePump() |