aboutsummaryrefslogtreecommitdiff
path: root/federationapi
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-09-02 17:13:15 +0100
committerGitHub <noreply@github.com>2020-09-02 17:13:15 +0100
commit9d9e854fe042cd2c83cf694d6b3e4c8e7046cde1 (patch)
tree75f9247df1d00b140c4249ef14b711b2839806bd /federationapi
parentf06637435b2124c89dfdd96cd723f54cc7055602 (diff)
Add Queryer and Inputer and factor out more RSAPI stuff (#1382)
* Add Queryer and use embedded structs * Add Inputer and factor out more RS API stuff This neatly splits up the RS API based on the functionality it provides, whilst providing a useful place for code sharing via the `helpers` package.
Diffstat (limited to 'federationapi')
-rw-r--r--federationapi/routing/join.go2
-rw-r--r--federationapi/routing/leave.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go
index ffdadd52..6cac1245 100644
--- a/federationapi/routing/join.go
+++ b/federationapi/routing/join.go
@@ -95,7 +95,7 @@ func MakeJoin(
queryRes := api.QueryLatestEventsAndStateResponse{
RoomVersion: verRes.RoomVersion,
}
- event, err := eventutil.BuildEvent(httpReq.Context(), &builder, cfg.Matrix, time.Now(), rsAPI, &queryRes)
+ event, err := eventutil.QueryAndBuildEvent(httpReq.Context(), &builder, cfg.Matrix, time.Now(), rsAPI, &queryRes)
if err == eventutil.ErrRoomNoExists {
return util.JSONResponse{
Code: http.StatusNotFound,
diff --git a/federationapi/routing/leave.go b/federationapi/routing/leave.go
index d2fbfc71..51162344 100644
--- a/federationapi/routing/leave.go
+++ b/federationapi/routing/leave.go
@@ -61,7 +61,7 @@ func MakeLeave(
}
var queryRes api.QueryLatestEventsAndStateResponse
- event, err := eventutil.BuildEvent(httpReq.Context(), &builder, cfg.Matrix, time.Now(), rsAPI, &queryRes)
+ event, err := eventutil.QueryAndBuildEvent(httpReq.Context(), &builder, cfg.Matrix, time.Now(), rsAPI, &queryRes)
if err == eventutil.ErrRoomNoExists {
return util.JSONResponse{
Code: http.StatusNotFound,