Skip to content

Commit 7acf32f

Browse files
JohennesS7evinK
andauthored
Add via parameter on join room requests as per MSC4156 (#3441)
This implements [MSC4156](matrix-org/matrix-spec-proposals#4156) which will ship with Matrix 1.12 and is the continuation of matrix-org/dendrite#3438. ### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [ ] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [x] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: Johannes Marbach <[email protected]> Signed-off-by: Johannes Marbach <[email protected]> Co-authored-by: Till <[email protected]>
1 parent 7cc7ebb commit 7acf32f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

clientapi/routing/joinroom.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@ func JoinRoomByIDOrAlias(
3636
Content: map[string]interface{}{},
3737
}
3838

39-
// Check to see if any ?server_name= query parameters were
40-
// given in the request.
41-
if serverNames, ok := req.URL.Query()["server_name"]; ok {
39+
// Check to see if any ?via= or ?server_name= query parameters
40+
// were given in the request.
41+
if serverNames, ok := req.URL.Query()["via"]; ok {
42+
for _, serverName := range serverNames {
43+
joinReq.ServerNames = append(
44+
joinReq.ServerNames,
45+
spec.ServerName(serverName),
46+
)
47+
}
48+
} else if serverNames, ok := req.URL.Query()["server_name"]; ok {
4249
for _, serverName := range serverNames {
4350
joinReq.ServerNames = append(
4451
joinReq.ServerNames,

0 commit comments

Comments
 (0)