Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit 9e7dea2

Browse files
committed
Remove redundant parameters
1 parent a31e949 commit 9e7dea2

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/github.com/matrix-org/dendrite/federationapi/routing/leave.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
package routing
1414

1515
import (
16-
"context"
1716
"encoding/json"
1817
"net/http"
1918

@@ -29,7 +28,6 @@ import (
2928

3029
// MakeLeave implements the /make_leave API
3130
func MakeLeave(
32-
ctx context.Context,
3331
httpReq *http.Request,
3432
request *gomatrixserverlib.FederationRequest,
3533
cfg config.Dendrite,
@@ -63,7 +61,7 @@ func MakeLeave(
6361
}
6462

6563
var queryRes api.QueryLatestEventsAndStateResponse
66-
event, err := common.BuildEvent(ctx, &builder, cfg, query, &queryRes)
64+
event, err := common.BuildEvent(httpReq.Context(), &builder, cfg, query, &queryRes)
6765
if err == common.ErrRoomNoExists {
6866
return util.JSONResponse{
6967
Code: http.StatusNotFound,
@@ -94,7 +92,6 @@ func MakeLeave(
9492

9593
// SendLeave implements the /send_leave API
9694
func SendLeave(
97-
ctx context.Context,
9895
httpReq *http.Request,
9996
request *gomatrixserverlib.FederationRequest,
10097
cfg config.Dendrite,
@@ -140,7 +137,7 @@ func SendLeave(
140137
Message: event.Redact().JSON(),
141138
AtTS: event.OriginServerTS(),
142139
}}
143-
verifyResults, err := keys.VerifyJSONs(ctx, verifyRequests)
140+
verifyResults, err := keys.VerifyJSONs(httpReq.Context(), verifyRequests)
144141
if err != nil {
145142
return httputil.LogThenError(httpReq, err)
146143
}
@@ -154,7 +151,7 @@ func SendLeave(
154151
// Send the events to the room server.
155152
// We are responsible for notifying other servers that the user has left
156153
// the room, so set SendAsServer to cfg.Matrix.ServerName
157-
_, err = producer.SendEvents(ctx, []gomatrixserverlib.Event{event}, cfg.Matrix.ServerName, nil)
154+
_, err = producer.SendEvents(httpReq.Context(), []gomatrixserverlib.Event{event}, cfg.Matrix.ServerName, nil)
158155
if err != nil {
159156
return httputil.LogThenError(httpReq, err)
160157
}

src/github.com/matrix-org/dendrite/federationapi/routing/routing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func Setup(
189189
roomID := vars["roomID"]
190190
userID := vars["userID"]
191191
return MakeLeave(
192-
httpReq.Context(), httpReq, request, cfg, query, roomID, userID,
192+
httpReq, request, cfg, query, roomID, userID,
193193
)
194194
},
195195
)).Methods(http.MethodGet)
@@ -201,7 +201,7 @@ func Setup(
201201
roomID := vars["roomID"]
202202
userID := vars["userID"]
203203
return SendLeave(
204-
httpReq.Context(), httpReq, request, cfg, producer, keys, roomID, userID,
204+
httpReq, request, cfg, producer, keys, roomID, userID,
205205
)
206206
},
207207
)).Methods(http.MethodPut)

0 commit comments

Comments
 (0)