mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
start hacking it out to get some debug logs
This commit is contained in:
parent
837f50ac89
commit
887bb12b74
|
|
@ -53,7 +53,7 @@ type databaseJoinedMember struct {
|
||||||
|
|
||||||
// GetMemberships implements GET /rooms/{roomId}/members
|
// GetMemberships implements GET /rooms/{roomId}/members
|
||||||
func GetMemberships(
|
func GetMemberships(
|
||||||
req *http.Request, device *userapi.Device, roomID string, joinedOnly bool,
|
req *http.Request, device *userapi.Device, roomID string, joinedOnly bool, at string,
|
||||||
_ *config.ClientAPI,
|
_ *config.ClientAPI,
|
||||||
rsAPI api.RoomserverInternalAPI,
|
rsAPI api.RoomserverInternalAPI,
|
||||||
) util.JSONResponse {
|
) util.JSONResponse {
|
||||||
|
|
@ -61,6 +61,7 @@ func GetMemberships(
|
||||||
JoinedOnly: joinedOnly,
|
JoinedOnly: joinedOnly,
|
||||||
RoomID: roomID,
|
RoomID: roomID,
|
||||||
Sender: device.UserID,
|
Sender: device.UserID,
|
||||||
|
At: at,
|
||||||
}
|
}
|
||||||
var queryRes api.QueryMembershipsForRoomResponse
|
var queryRes api.QueryMembershipsForRoomResponse
|
||||||
if err := rsAPI.QueryMembershipsForRoom(req.Context(), &queryReq, &queryRes); err != nil {
|
if err := rsAPI.QueryMembershipsForRoom(req.Context(), &queryReq, &queryRes); err != nil {
|
||||||
|
|
@ -91,6 +92,14 @@ func GetMemberships(
|
||||||
JSON: res,
|
JSON: res,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
util.GetLogger(req.Context()).Info("SLOCKART")
|
||||||
|
for _, ev := range queryRes.JoinEvents {
|
||||||
|
util.GetLogger(req.Context()).Info(ev)
|
||||||
|
util.GetLogger(req.Context()).Info(at)
|
||||||
|
}
|
||||||
|
util.GetLogger(req.Context()).Error("SLOCKART")
|
||||||
|
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusOK,
|
Code: http.StatusOK,
|
||||||
JSON: getMembershipResponse{queryRes.JoinEvents},
|
JSON: getMembershipResponse{queryRes.JoinEvents},
|
||||||
|
|
|
||||||
|
|
@ -751,7 +751,10 @@ func Setup(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return util.ErrorResponse(err)
|
return util.ErrorResponse(err)
|
||||||
}
|
}
|
||||||
return GetMemberships(req, device, vars["roomID"], false, cfg, rsAPI)
|
at := req.URL.Query().Get("at")
|
||||||
|
logrus.Info(req.URL)
|
||||||
|
|
||||||
|
return GetMemberships(req, device, vars["roomID"], false, at, cfg, rsAPI)
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
|
||||||
|
|
@ -761,7 +764,7 @@ func Setup(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return util.ErrorResponse(err)
|
return util.ErrorResponse(err)
|
||||||
}
|
}
|
||||||
return GetMemberships(req, device, vars["roomID"], true, cfg, rsAPI)
|
return GetMemberships(req, device, vars["roomID"], true, "", cfg, rsAPI)
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,8 @@ type QueryMembershipsForRoomRequest struct {
|
||||||
// user is allowed to see the memberships. If not specified then all
|
// user is allowed to see the memberships. If not specified then all
|
||||||
// room memberships will be returned.
|
// room memberships will be returned.
|
||||||
Sender string `json:"sender"`
|
Sender string `json:"sender"`
|
||||||
|
|
||||||
|
At string `json:"at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryMembershipsForRoomResponse is a response to QueryMembershipsForRoom
|
// QueryMembershipsForRoomResponse is a response to QueryMembershipsForRoom
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue