From bea49cbcf3605a6cab28bc54be41d59d7b627f38 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 21 Mar 2017 18:43:16 -0400 Subject: Add ability to use 'me' in place of user id for APIv4 (#5826) --- api4/context.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'api4/context.go') diff --git a/api4/context.go b/api4/context.go index fe2e8d35b..9fb1361bc 100644 --- a/api4/context.go +++ b/api4/context.go @@ -333,6 +333,10 @@ func (c *Context) RequireUserId() *Context { return c } + if c.Params.UserId == model.ME { + c.Params.UserId = c.Session.UserId + } + if len(c.Params.UserId) != 26 { c.SetInvalidUrlParam("user_id") } -- cgit v1.2.3-1-g7c22