diff options
author | Kegsay <kegan@matrix.org> | 2020-09-02 17:13:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 17:13:15 +0100 |
commit | 9d9e854fe042cd2c83cf694d6b3e4c8e7046cde1 (patch) | |
tree | 75f9247df1d00b140c4249ef14b711b2839806bd /clientapi | |
parent | f06637435b2124c89dfdd96cd723f54cc7055602 (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 'clientapi')
-rw-r--r-- | clientapi/routing/membership.go | 2 | ||||
-rw-r--r-- | clientapi/routing/profile.go | 2 | ||||
-rw-r--r-- | clientapi/routing/redaction.go | 2 | ||||
-rw-r--r-- | clientapi/routing/sendevent.go | 2 | ||||
-rw-r--r-- | clientapi/threepid/invites.go | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index 5d635c01..cba19a24 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -270,7 +270,7 @@ func buildMembershipEvent( return nil, err } - return eventutil.BuildEvent(ctx, &builder, cfg.Matrix, evTime, rsAPI, nil) + return eventutil.QueryAndBuildEvent(ctx, &builder, cfg.Matrix, evTime, rsAPI, nil) } // loadProfile lookups the profile of a given user from the database and returns diff --git a/clientapi/routing/profile.go b/clientapi/routing/profile.go index faf92451..4c7895bd 100644 --- a/clientapi/routing/profile.go +++ b/clientapi/routing/profile.go @@ -375,7 +375,7 @@ func buildMembershipEvents( return nil, err } - event, err := eventutil.BuildEvent(ctx, &builder, cfg.Matrix, evTime, rsAPI, nil) + event, err := eventutil.QueryAndBuildEvent(ctx, &builder, cfg.Matrix, evTime, rsAPI, nil) if err != nil { return nil, err } diff --git a/clientapi/routing/redaction.go b/clientapi/routing/redaction.go index bb526513..a825da64 100644 --- a/clientapi/routing/redaction.go +++ b/clientapi/routing/redaction.go @@ -115,7 +115,7 @@ func SendRedaction( } var queryRes api.QueryLatestEventsAndStateResponse - e, err := eventutil.BuildEvent(req.Context(), &builder, cfg.Matrix, time.Now(), rsAPI, &queryRes) + e, err := eventutil.QueryAndBuildEvent(req.Context(), &builder, cfg.Matrix, time.Now(), rsAPI, &queryRes) if err == eventutil.ErrRoomNoExists { return util.JSONResponse{ Code: http.StatusNotFound, diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go index 9cf517cf..a25979ea 100644 --- a/clientapi/routing/sendevent.go +++ b/clientapi/routing/sendevent.go @@ -158,7 +158,7 @@ func generateSendEvent( } var queryRes api.QueryLatestEventsAndStateResponse - e, err := eventutil.BuildEvent(req.Context(), &builder, cfg.Matrix, evTime, rsAPI, &queryRes) + e, err := eventutil.QueryAndBuildEvent(req.Context(), &builder, cfg.Matrix, evTime, rsAPI, &queryRes) if err == eventutil.ErrRoomNoExists { return nil, &util.JSONResponse{ Code: http.StatusNotFound, diff --git a/clientapi/threepid/invites.go b/clientapi/threepid/invites.go index f1d54a47..2ffb6bb0 100644 --- a/clientapi/threepid/invites.go +++ b/clientapi/threepid/invites.go @@ -354,7 +354,7 @@ func emit3PIDInviteEvent( } queryRes := api.QueryLatestEventsAndStateResponse{} - event, err := eventutil.BuildEvent(ctx, builder, cfg.Matrix, evTime, rsAPI, &queryRes) + event, err := eventutil.QueryAndBuildEvent(ctx, builder, cfg.Matrix, evTime, rsAPI, &queryRes) if err != nil { return err } |