Add ability to use 'me' in place of user id for APIv4 (#5826)

Этот коммит содержится в:
Joram Wilander
2017-03-21 18:43:16 -04:00
коммит произвёл GitHub
родитель fd6e2f3f73
Коммит bea49cbcf3
4 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@@ -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")
}