Skip to content

Commit

Permalink
Implement archived rooms (include_leave filter on /sync)
Browse files Browse the repository at this point in the history
Fix #1323
  • Loading branch information
MadLittleMods committed Dec 23, 2020
1 parent e1ace7e commit 61740f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions syncapi/routing/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func Setup(
r0mux := csMux.PathPrefix("/r0").Subrouter()

// TODO: Add AS support for all handlers below.
// asdf
r0mux.Handle("/sync", httputil.MakeAuthAPI("sync", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
return srp.OnIncomingSyncRequest(req, device)
})).Methods(http.MethodGet, http.MethodOptions)
Expand Down
7 changes: 6 additions & 1 deletion syncapi/sync/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const DefaultTimelineLimit = 20

type filter struct {
Room struct {
Timeline struct {
IncludeLeave *bool `json:"include_leave"`
Timeline struct {
Limit *int `json:"limit"`
} `json:"timeline"`
} `json:"room"`
Expand Down Expand Up @@ -78,6 +79,10 @@ func newSyncRequest(req *http.Request, device userapi.Device, syncDB storage.Dat
if err == nil && f.Room.Timeline.Limit != nil {
timelineLimit = *f.Room.Timeline.Limit
}
util.GetLogger(req.Context()).WithFields(log.Fields{
"filter": f,
"filterQuery": filterQuery,
}).Info("Input filter")
} else {
// attempt to load the filter ID
localpart, _, err := gomatrixserverlib.SplitID('@', device.UserID)
Expand Down

0 comments on commit 61740f9

Please sign in to comment.