Skip to content

Commit

Permalink
Add via parameter on join room requests as per MSC4156
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Marbach <[email protected]>
  • Loading branch information
Johennes committed Oct 7, 2024
1 parent 6cd1285 commit 0ec82fb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions clientapi/routing/joinroom.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ func JoinRoomByIDOrAlias(
Content: map[string]interface{}{},
}

// Check to see if any ?server_name= query parameters were
// given in the request.
if serverNames, ok := req.URL.Query()["server_name"]; ok {
// Check to see if any ?via= or ?server_name= query parameters
// were given in the request.
if serverNames, ok := req.URL.Query()["via"]; ok {
for _, serverName := range serverNames {
joinReq.ServerNames = append(
joinReq.ServerNames,
spec.ServerName(serverName),
)
}
} else if serverNames, ok := req.URL.Query()["server_name"]; ok {
for _, serverName := range serverNames {
joinReq.ServerNames = append(
joinReq.ServerNames,
Expand Down

0 comments on commit 0ec82fb

Please sign in to comment.