PDU Sender split (#3100)
Initial cut of splitting PDU Sender into SenderID & looking up UserID where required.
This commit is contained in:
parent
725ff5567d
commit
7a1fd7f512
66 changed files with 580 additions and 189 deletions
|
|
@ -92,9 +92,11 @@ type MSC2836EventRelationshipsResponse struct {
|
|||
ParsedAuthChain []gomatrixserverlib.PDU
|
||||
}
|
||||
|
||||
func toClientResponse(res *MSC2836EventRelationshipsResponse) *EventRelationshipResponse {
|
||||
func toClientResponse(ctx context.Context, res *MSC2836EventRelationshipsResponse, rsAPI roomserver.RoomserverInternalAPI) *EventRelationshipResponse {
|
||||
out := &EventRelationshipResponse{
|
||||
Events: synctypes.ToClientEvents(gomatrixserverlib.ToPDUs(res.ParsedEvents), synctypes.FormatAll),
|
||||
Events: synctypes.ToClientEvents(gomatrixserverlib.ToPDUs(res.ParsedEvents), synctypes.FormatAll, func(roomID, senderID string) (*spec.UserID, error) {
|
||||
return rsAPI.QueryUserIDForSender(ctx, roomID, senderID)
|
||||
}),
|
||||
Limited: res.Limited,
|
||||
NextBatch: res.NextBatch,
|
||||
}
|
||||
|
|
@ -187,7 +189,7 @@ func eventRelationshipHandler(db Database, rsAPI roomserver.RoomserverInternalAP
|
|||
|
||||
return util.JSONResponse{
|
||||
Code: 200,
|
||||
JSON: toClientResponse(res),
|
||||
JSON: toClientResponse(req.Context(), res, rsAPI),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue