Membership viewing API (#174)

* Basic memberships retrieval

* Change the way the memberships are saved in the client API database

* Retrieve single membership

* Get memberships only if the user is or has been in the room

* Check server name on room ID instead of user ID

* Save the join membership event and updates it when necessary

* Membership events retrieval + update on leave

* Implement the API on the roomserver and client API server

* Fix comments

* Remove the functions and attributes used before the new query API

* Explicitely state what we return in query

* Remove tab
This commit is contained in:
Brendan Abolivier 2017-08-21 16:34:26 +01:00 committed by GitHub
parent 81179a0595
commit 5950293e79
11 changed files with 383 additions and 48 deletions

View file

@ -313,6 +313,13 @@ func Setup(
}),
)
r0mux.Handle("/rooms/{roomID}/members",
common.MakeAuthAPI("rooms_members", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
vars := mux.Vars(req)
return readers.GetMemberships(req, device, vars["roomID"], accountDB, cfg, queryAPI)
}),
)
r0mux.Handle("/rooms/{roomID}/read_markers",
common.MakeAPI("rooms_read_markers", func(req *http.Request) util.JSONResponse {
// TODO: return the read_markers.