summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-07-06 06:07:09 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-07-06 09:07:09 -0400
commit4c1ddcff10b359baf5728b334acb60cc3e1b1123 (patch)
tree40e9ae1aa914c7a8676da8ae3e10fbc8e2b36d95 /web
parent7bfb5aec26c6bb8c49fa19e8347bc91acc86fe92 (diff)
downloadchat-4c1ddcff10b359baf5728b334acb60cc3e1b1123.tar.gz
chat-4c1ddcff10b359baf5728b334acb60cc3e1b1123.tar.bz2
chat-4c1ddcff10b359baf5728b334acb60cc3e1b1123.zip
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.
Diffstat (limited to 'web')
-rw-r--r--web/context.go9
1 files changed, 9 insertions, 0 deletions
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,
+ }
+}