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 Nov 14, 2024
1 parent 3ca9dae commit 207e92a
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 @@ -36,9 +36,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 207e92a

Please sign in to comment.