Tweak that again

This commit is contained in:
Neil Alexander 2022-05-05 12:43:23 +01:00
parent 3d4985ef10
commit 0a8e6dbbfb
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -265,6 +265,9 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
syncReq.Log.WithField("currentPos", currentPos).Debugln("Responding to sync immediately") syncReq.Log.WithField("currentPos", currentPos).Debugln("Responding to sync immediately")
} }
defer rp.updateLastSeen(req, device)
rp.updatePresence(req.Context(), rp.db, req.FormValue("set_presence"), device.UserID)
if syncReq.Since.IsEmpty() { if syncReq.Since.IsEmpty() {
// Complete sync // Complete sync
syncReq.Response.NextBatch = types.StreamingToken{ syncReq.Response.NextBatch = types.StreamingToken{
@ -338,9 +341,6 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
} }
} }
rp.updateLastSeen(req, device)
rp.updatePresence(req.Context(), rp.db, req.FormValue("set_presence"), device.UserID)
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusOK, Code: http.StatusOK,
JSON: syncReq.Response, JSON: syncReq.Response,