summaryrefslogtreecommitdiffstats
path: root/app/session.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-19 18:31:35 -0500
committerGitHub <noreply@github.com>2017-09-19 18:31:35 -0500
commitac74066f0e4f3d62f2d4645c3fa34b88c13958d1 (patch)
tree9e1cb80eae1b4a2e9dcc2272744c4a9db1b4b804 /app/session.go
parent7e4ff6adcccc4cc5a8fb8cfa853417ec52bf78f4 (diff)
downloadchat-ac74066f0e4f3d62f2d4645c3fa34b88c13958d1.tar.gz
chat-ac74066f0e4f3d62f2d4645c3fa34b88c13958d1.tar.bz2
chat-ac74066f0e4f3d62f2d4645c3fa34b88c13958d1.zip
remove einterface gets (#7455)
Diffstat (limited to 'app/session.go')
-rw-r--r--app/session.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/app/session.go b/app/session.go
index bf1a24c58..e5e5c939d 100644
--- a/app/session.go
+++ b/app/session.go
@@ -6,7 +6,6 @@ package app
import (
"net/http"
- "github.com/mattermost/mattermost-server/einterfaces"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
@@ -30,7 +29,7 @@ func (a *App) CreateSession(session *model.Session) (*model.Session, *model.AppE
}
func (a *App) GetSession(token string) (*model.Session, *model.AppError) {
- metrics := einterfaces.GetMetricsInterface()
+ metrics := a.Metrics
var session *model.Session
if ts, ok := sessionCache.Get(token); ok {
@@ -102,22 +101,22 @@ func (a *App) RevokeAllSessions(userId string) *model.AppError {
}
}
- ClearSessionCacheForUser(userId)
+ a.ClearSessionCacheForUser(userId)
return nil
}
-func ClearSessionCacheForUser(userId string) {
+func (a *App) ClearSessionCacheForUser(userId string) {
ClearSessionCacheForUserSkipClusterSend(userId)
- if einterfaces.GetClusterInterface() != nil {
+ if a.Cluster != nil {
msg := &model.ClusterMessage{
Event: model.CLUSTER_EVENT_CLEAR_SESSION_CACHE_FOR_USER,
SendType: model.CLUSTER_SEND_BEST_EFFORT,
Data: userId,
}
- einterfaces.GetClusterInterface().SendClusterMessage(msg)
+ a.Cluster.SendClusterMessage(msg)
}
}
@@ -185,7 +184,7 @@ func (a *App) RevokeSession(session *model.Session) *model.AppError {
}
RevokeWebrtcToken(session.Id)
- ClearSessionCacheForUser(session.UserId)
+ a.ClearSessionCacheForUser(session.UserId)
return nil
}