Only update session activity on specific endpoints (#7549)
Этот коммит содержится в:
коммит произвёл
Chris
родитель
5e69ce099f
Коммит
3e144f82e2
@@ -716,6 +716,8 @@ func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.App.UpdateLastActivityAtIfNeeded(c.Session)
|
||||||
|
|
||||||
// Returning {"status": "OK", ...} for backwards compatability
|
// Returning {"status": "OK", ...} for backwards compatability
|
||||||
resp := &model.ChannelViewResponse{
|
resp := &model.ChannelViewResponse{
|
||||||
Status: "OK",
|
Status: "OK",
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
c.Err = model.NewAppError("ServeHTTP", "api.context.token_provided.app_error", nil, "token="+token, http.StatusUnauthorized)
|
c.Err = model.NewAppError("ServeHTTP", "api.context.token_provided.app_error", nil, "token="+token, http.StatusUnauthorized)
|
||||||
} else {
|
} else {
|
||||||
c.Session = *session
|
c.Session = *session
|
||||||
c.App.UpdateLastActivityAtIfNeeded(*session)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ func createPost(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c.App.SetStatusOnline(c.Session.UserId, c.Session.Id, false)
|
c.App.SetStatusOnline(c.Session.UserId, c.Session.Id, false)
|
||||||
|
c.App.UpdateLastActivityAtIfNeeded(c.Session)
|
||||||
|
|
||||||
w.WriteHeader(http.StatusCreated)
|
w.WriteHeader(http.StatusCreated)
|
||||||
w.Write([]byte(rp.ToJson()))
|
w.Write([]byte(rp.ToJson()))
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ func getUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
} else {
|
} else {
|
||||||
app.SanitizeProfile(user, c.IsSystemAdmin())
|
app.SanitizeProfile(user, c.IsSystemAdmin())
|
||||||
}
|
}
|
||||||
|
c.App.UpdateLastActivityAtIfNeeded(c.Session)
|
||||||
w.Header().Set(model.HEADER_ETAG_SERVER, etag)
|
w.Header().Set(model.HEADER_ETAG_SERVER, etag)
|
||||||
w.Write([]byte(user.ToJson()))
|
w.Write([]byte(user.ToJson()))
|
||||||
return
|
return
|
||||||
@@ -369,6 +370,7 @@ func getUsers(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
if len(etag) > 0 {
|
if len(etag) > 0 {
|
||||||
w.Header().Set(model.HEADER_ETAG_SERVER, etag)
|
w.Header().Set(model.HEADER_ETAG_SERVER, etag)
|
||||||
}
|
}
|
||||||
|
c.App.UpdateLastActivityAtIfNeeded(c.Session)
|
||||||
w.Write([]byte(model.UserListToJson(profiles)))
|
w.Write([]byte(model.UserListToJson(profiles)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user