PDU Sender split (#3100)

Initial cut of splitting PDU Sender into SenderID & looking up UserID where required.
This commit is contained in:
devonh 2023-06-06 20:55:18 +00:00 committed by GitHub
parent 725ff5567d
commit 7a1fd7f512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 580 additions and 189 deletions

View file

@ -144,7 +144,7 @@ func GetMemberships(
JSON: spec.InternalServerError{},
}
}
res.Joined[ev.Sender()] = joinedMember(content)
res.Joined[ev.SenderID()] = joinedMember(content)
}
return util.JSONResponse{
Code: http.StatusOK,
@ -153,6 +153,8 @@ func GetMemberships(
}
return util.JSONResponse{
Code: http.StatusOK,
JSON: getMembershipResponse{synctypes.ToClientEvents(gomatrixserverlib.ToPDUs(result), synctypes.FormatAll)},
JSON: getMembershipResponse{synctypes.ToClientEvents(gomatrixserverlib.ToPDUs(result), synctypes.FormatAll, func(roomID, senderID string) (*spec.UserID, error) {
return rsAPI.QueryUserIDForSender(req.Context(), roomID, senderID)
})},
}
}