From 4c1ddcff10b359baf5728b334acb60cc3e1b1123 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 6 Jul 2018 06:07:09 -0700 Subject: MM-10703 Adding blank request context to plugin hooks for future use. (#9043) * Adding blank request context to plugin hooks for future use. * Rename RequestContext to Context * Adding context to ServeHTTP and ExecuteCommand * Fixing import cycle in test. --- web/context.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'web/context.go') diff --git a/web/context.go b/web/context.go index 5eb8c94d5..3b2ffa17c 100644 --- a/web/context.go +++ b/web/context.go @@ -14,6 +14,7 @@ import ( "github.com/mattermost/mattermost-server/app" "github.com/mattermost/mattermost-server/mlog" "github.com/mattermost/mattermost-server/model" + "github.com/mattermost/mattermost-server/plugin" "github.com/mattermost/mattermost-server/utils" ) @@ -526,3 +527,11 @@ func (c *Context) RequireRoleName() *Context { return c } + +func (c *Context) ToPluginContext() *plugin.Context { + return &plugin.Context{ + //sessionId: c.Session.Id, + //requestId: c.RequestId, + //userIp: c.IpAddress, + } +} -- cgit v1.2.3-1-g7c22