26 lines
837 B
Go
26 lines
837 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package app
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost/server/public/plugin"
|
|
"github.com/mattermost/mattermost/server/public/shared/request"
|
|
"github.com/mattermost/mattermost/server/v8/channels/store/sqlstore"
|
|
)
|
|
|
|
// RequestContextWithMaster adds the context value that master DB should be selected for this request.
|
|
func RequestContextWithMaster(rctx request.CTX) request.CTX {
|
|
return sqlstore.RequestContextWithMaster(rctx)
|
|
}
|
|
|
|
func pluginContext(rctx request.CTX) *plugin.Context {
|
|
context := &plugin.Context{
|
|
RequestId: rctx.RequestId(),
|
|
SessionId: rctx.Session().Id,
|
|
IPAddress: rctx.IPAddress(),
|
|
AcceptLanguage: rctx.AcceptLanguage(),
|
|
UserAgent: rctx.UserAgent(),
|
|
}
|
|
return context
|
|
}
|